-
-
Notifications
You must be signed in to change notification settings - Fork 615
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ADD] adding a pos.config parameter 'display_default_code' to enable/…
…disable product's internal reference * 'display_default_code' field view in PoS -> settings -> PoS Interface [NEW] new files: contributors.rst, configure.rst
- Loading branch information
Showing
15 changed files
with
129 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
13 changes: 0 additions & 13 deletions
13
pos_product_display_default_code/i18n/pos_product_display_default_code.pot
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
# Copyright 2023 FactorLibre - Juan Carlos Bonilla | ||
from . import pos_session | ||
from . import pos_config | ||
from . import res_config_settings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
pos_product_display_default_code/models/res_config_settings.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* Juan Carlos Bonilla <[email protected]> |
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Copyright 2023 FactorLibre - Juan Carlos Bonilla | ||
from . import test_load_params_productqq |
18 changes: 18 additions & 0 deletions
18
pos_product_display_default_code/tests/test_load_params_product.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Copyright 2023 FactorLibre - Juan Carlos Bonilla | ||
|
||
import odoo | ||
|
||
from odoo.addons.point_of_sale.tests.common import TestPoSCommon | ||
|
||
|
||
@odoo.tests.tagged("post_install", "-at_install") | ||
class TestPosDisplayDefaultCode(TestPoSCommon): | ||
def setUp(self): | ||
super(TestPosDisplayDefaultCode, self).setUp() | ||
self.config = self.basic_config | ||
self.config.display_default_code = True | ||
self.pos_session = self.env["pos.session"].create({"config_id": self.config.id}) | ||
|
||
def test_load_params_products(self): | ||
result = self.pos_session._loader_params_product_product() | ||
self.assertTrue(result["context"]["display_default_code"]) |
29 changes: 29 additions & 0 deletions
29
pos_product_display_default_code/views/res_config_settings_views.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<odoo> | ||
<record id="res_config_settings_default_code_view_form" model="ir.ui.view"> | ||
<field name="name">res.config.settings.default.code.view.form</field> | ||
<field name="model">res.config.settings</field> | ||
<field name="inherit_id" ref="point_of_sale.res_config_settings_view_form" /> | ||
<field name="arch" type="xml"> | ||
<xpath | ||
expr="//field[@name='pos_is_margins_costs_accessible_to_every_user']/../.." | ||
position="after" | ||
> | ||
<div class="col-12 col-lg-6 o_setting_box"> | ||
<div class="o_setting_left_pane"> | ||
<field name="pos_display_default_code" /> | ||
</div> | ||
<div class="o_setting_right_pane"> | ||
<label | ||
for="pos_display_default_code" | ||
string="Display Default Code" | ||
/> | ||
<div class="text-muted"> | ||
Display products' internal reference in the PoS interface and tickets. | ||
</div> | ||
</div> | ||
</div> | ||
</xpath> | ||
</field> | ||
</record> | ||
</odoo> |