Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][MIG] pos product display default code: migration to 16.0 #927

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 77 additions & 0 deletions pos_product_display_default_code/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
================================
PoS Product Display Default Code
================================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpos-lightgray.png?logo=github
:target: https://github.com/OCA/pos/tree/16.0/pos_product_display_default_code
:alt: OCA/pos
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/pos-16-0/pos-16-0-pos_product_display_default_code
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/184/16.0
:alt: Try me on Runbot

|badge1| |badge2| |badge3| |badge4| |badge5|

This module makes Odoo show the internal reference of the product in the Point of Sale.

The reference will appear in the products list, in the orderlines and in the receipt.

example: Desk Organizer -> [FURN_0001] Desk Organizer

**Table of contents**

.. contents::
:local:

Known issues / Roadmap
======================

add an option in pos.config to activate/deactivate

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/pos/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/pos/issues/new?body=module:%20pos_product_display_default_code%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
~~~~~~~

* Akretion

Maintainers
~~~~~~~~~~~

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/pos <https://github.com/OCA/pos/tree/16.0/pos_product_display_default_code>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 2 additions & 0 deletions pos_product_display_default_code/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Copyright 2023 FactorLibre - Juan Carlos Bonilla
from . import models
19 changes: 19 additions & 0 deletions pos_product_display_default_code/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "PoS Product Display Default Code",
"summary": "pos: display product default code before product name",
"version": "16.0.1.0.0",
"category": "Point of Sale",
"website": "https://github.com/OCA/pos",
"author": "Odoo Community Association (OCA), Akretion, FactorLibre",
"license": "AGPL-3",
"application": False,
"installable": True,
"depends": [
"point_of_sale",
],
"data": [
"views/res_config_settings_views.xml",
],
"demo": [],
"qweb": [],
}
43 changes: 43 additions & 0 deletions pos_product_display_default_code/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * pos_product_display_default_code
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-02-14 15:18+0000\n"
"PO-Revision-Date: 2023-02-14 15:18+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: pos_product_display_default_code
#: model:ir.model,name:pos_product_display_default_code.model_res_config_settings
msgid "Config Settings"
msgstr "Opciones de configuración"

#. module: pos_product_display_default_code
#: model:ir.model.fields,field_description:pos_product_display_default_code.field_pos_config__display_default_code
#: model:ir.model.fields,field_description:pos_product_display_default_code.field_res_config_settings__pos_display_default_code
#: model_terms:ir.ui.view,arch_db:pos_product_display_default_code.res_config_settings_default_code_view_form
msgid "Display Default Code"
msgstr "Mostrar referencia interna"

#. module: pos_product_display_default_code
#: model_terms:ir.ui.view,arch_db:pos_product_display_default_code.res_config_settings_default_code_view_form
msgid "Display products' internal reference in the PoS interface and tickets."
msgstr "Mostrar referencia interna del producto en la interfaz del TPV y tickets."

#. module: pos_product_display_default_code
#: model:ir.model,name:pos_product_display_default_code.model_pos_config
msgid "Point of Sale Configuration"
msgstr "Configuración del TPV"

#. module: pos_product_display_default_code
#: model:ir.model,name:pos_product_display_default_code.model_pos_session
msgid "Point of Sale Session"
msgstr "Sesión TPV"
4 changes: 4 additions & 0 deletions pos_product_display_default_code/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright 2023 FactorLibre - Juan Carlos Bonilla
from . import pos_session
from . import pos_config
from . import res_config_settings
8 changes: 8 additions & 0 deletions pos_product_display_default_code/models/pos_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Copyright 2023 FactorLibre - Juan Carlos Bonilla
from odoo import fields, models


class PosConfig(models.Model):
_inherit = "pos.config"

display_default_code = fields.Boolean(default=False)
12 changes: 12 additions & 0 deletions pos_product_display_default_code/models/pos_session.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Copyright 2023 FactorLibre - Juan Carlos Bonilla
from odoo import models


class PosSession(models.Model):
_inherit = "pos.session"

def _loader_params_product_product(self):
result = super()._loader_params_product_product()
if self.config_id and self.config_id.display_default_code:
result["context"]["display_default_code"] = True
return result
10 changes: 10 additions & 0 deletions pos_product_display_default_code/models/res_config_settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright 2023 FactorLibre - Juan Carlos Bonilla
from odoo import fields, models


class ResConfigSettings(models.TransientModel):
_inherit = "res.config.settings"

pos_display_default_code = fields.Boolean(
related="pos_config_id.display_default_code", readonly=False
)
5 changes: 5 additions & 0 deletions pos_product_display_default_code/readme/CONFIGURE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
* Go to Point Of Sale / Configuration / Settings
* Check the box 'Display Default Code' in PoS Interface section

.. image:: ../static/description/config.png
:width: 800 px
1 change: 1 addition & 0 deletions pos_product_display_default_code/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Juan Carlos Bonilla <juancarlos.bonilla@factorlibre.com>
5 changes: 5 additions & 0 deletions pos_product_display_default_code/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
This module makes Odoo show the internal reference of the product in the Point of Sale.

The reference will appear in the products list, in the orderlines and in the receipt.

example: Desk Organizer -> [FURN_0001] Desk Organizer
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading