Skip to content
Open
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
93 changes: 93 additions & 0 deletions pos_product_display_default_code/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
================================
PoS Product Display Default Code
================================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:c5af4f675060779057788e9fe94ae2bbb0e2cdf6d6475a008fe39220e292cfc9
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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/18.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-18-0/pos-18-0-pos_product_display_default_code
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/pos&target_branch=18.0
:alt: Try me on Runboat

|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 -> [FURN0001] Desk Organizer

**Table of contents**

.. contents::
:local:

Configuration
=============

- Go to Point Of Sale / Configuration / Settings
- Check the box 'Display Default Code' in PoS Interface section

|image|

.. |image| image:: https://raw.githubusercontent.com/OCA/pos/18.0/pos_product_display_default_code/static/description/config.png

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 to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/pos/issues/new?body=module:%20pos_product_display_default_code%0Aversion:%2018.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
* FactorLibre

Contributors
------------

- Juan Carlos Bonilla <[email protected]>

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/18.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
24 changes: 24 additions & 0 deletions pos_product_display_default_code/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "PoS Product Display Default Code",
"summary": "pos: display product default code before product name",
"version": "18.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",
],
"assets": {
"web.assets_tests": [
"pos_product_display_default_code/static/tests/tours/**/*",
],
},
"demo": [],
"qweb": [],
}
46 changes: 46 additions & 0 deletions pos_product_display_default_code/i18n/de.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# 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"
"PO-Revision-Date: 2025-10-22 10:42+0000\n"
"Last-Translator: Bastian Günther <[email protected]>\n"
"Language-Team: none\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 5.10.4\n"

#. module: pos_product_display_default_code
#: model:ir.model,name:pos_product_display_default_code.model_res_config_settings
msgid "Config Settings"
msgstr "Konfigurationseinstellungen"

#. 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 "Standardcode anzeigen"

#. 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 ""
"Interne Referenz der Produkte in der PoS-Oberfläche und auf den Belegen "
"anzeigen."

#. module: pos_product_display_default_code
#: model:ir.model,name:pos_product_display_default_code.model_pos_config
msgid "Point of Sale Configuration"
msgstr "Kassensystem-Konfiguration"

#. module: pos_product_display_default_code
#: model:ir.model,name:pos_product_display_default_code.model_pos_session
msgid "Point of Sale Session"
msgstr "Kassensitzung"
45 changes: 45 additions & 0 deletions pos_product_display_default_code/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# 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"
"Language: \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"
45 changes: 45 additions & 0 deletions pos_product_display_default_code/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# 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"
"PO-Revision-Date: 2023-03-09 13:22+0000\n"
"Last-Translator: mymage <[email protected]>\n"
"Language-Team: none\n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.14.1\n"

#. module: pos_product_display_default_code
#: model:ir.model,name:pos_product_display_default_code.model_res_config_settings
msgid "Config Settings"
msgstr "Impostazioni configurazione"

#. 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 "Visualizza codice predefinito"

#. 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 ""
"Visualizza riferimento interno del prodotto nell'interfaccia e scontrini PoS."

#. module: pos_product_display_default_code
#: model:ir.model,name:pos_product_display_default_code.model_pos_config
msgid "Point of Sale Configuration"
msgstr "Configurazione punto vendita"

#. module: pos_product_display_default_code
#: model:ir.model,name:pos_product_display_default_code.model_pos_session
msgid "Point of Sale Session"
msgstr "Sessione punto vendita"
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# 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"
"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 ""

#. 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 ""

#. 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 ""

#. module: pos_product_display_default_code
#: model:ir.model,name:pos_product_display_default_code.model_pos_config
msgid "Point of Sale Configuration"
msgstr ""

#. module: pos_product_display_default_code
#: model:ir.model,name:pos_product_display_default_code.model_pos_session
msgid "Point of Sale Session"
msgstr ""
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 product
from . import pos_config
from . import res_config_settings
14 changes: 14 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,14 @@
# 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)

def get_limited_products_loading(self, fields):
if self.display_default_code:
self = self.with_context(display_default_code=True)
res = super().get_limited_products_loading(fields)
return res
17 changes: 17 additions & 0 deletions pos_product_display_default_code/models/product.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from odoo import models


class ProductProduct(models.Model):
_inherit = "product.product"

def _load_product_with_domain(self, domain, config_id, load_archived=False):
res = super()._load_product_with_domain(domain, config_id, load_archived)
pos_config = self.env["pos.config"].search([("id", "=", config_id)])
if pos_config.display_default_code:
# We have no choice but overwriting the original method
# because it's not easy to change context
fields = self._load_pos_data_fields(config_id)
res = self.with_context(display_default_code=True).search_read(
domain, fields, order="sequence,default_code,name", load=False
)
return res
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
)
3 changes: 3 additions & 0 deletions pos_product_display_default_code/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
4 changes: 4 additions & 0 deletions pos_product_display_default_code/readme/CONFIGURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- Go to Point Of Sale / Configuration / Settings
- Check the box 'Display Default Code' in PoS Interface section

![image](../static/description/config.png)
1 change: 1 addition & 0 deletions pos_product_display_default_code/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Juan Carlos Bonilla \<<[email protected]>\>
7 changes: 7 additions & 0 deletions pos_product_display_default_code/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
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 -\> \[FURN0001\] 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
Loading