diff --git a/pos_config_show_accounting/__init__.py b/pos_config_show_accounting/__init__.py new file mode 100644 index 00000000..0650744f --- /dev/null +++ b/pos_config_show_accounting/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/pos_config_show_accounting/__manifest__.py b/pos_config_show_accounting/__manifest__.py new file mode 100644 index 00000000..253bf8b8 --- /dev/null +++ b/pos_config_show_accounting/__manifest__.py @@ -0,0 +1,17 @@ +# Copyright 2018 Eficent Business and IT Consulting Services, S.L. +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). + +{ + 'name': 'POS Config Show Accounting', + 'version': '11.0.1.0.0', + 'category': 'Point Of Sale', + 'author': "Eficent," + "Odoo Community Association (OCA)", + 'website': 'https://github.com/OCA/pos', + 'summary': 'Always display accounting settings in POS Config', + "license": "LGPL-3", + 'depends': [ + "point_of_sale", + ], + 'installable': True, +} diff --git a/pos_config_show_accounting/models/__init__.py b/pos_config_show_accounting/models/__init__.py new file mode 100644 index 00000000..db8634ad --- /dev/null +++ b/pos_config_show_accounting/models/__init__.py @@ -0,0 +1 @@ +from . import pos_config diff --git a/pos_config_show_accounting/models/pos_config.py b/pos_config_show_accounting/models/pos_config.py new file mode 100644 index 00000000..d29eeabe --- /dev/null +++ b/pos_config_show_accounting/models/pos_config.py @@ -0,0 +1,16 @@ +# Copyright 2018 Eficent +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). + +from odoo import fields, models + + +class PosConfig(models.Model): + _inherit = 'pos.config' + + is_installed_account_accountant = fields.Boolean( + compute="_compute_is_installed_account_accountant") + + def _compute_is_installed_account_accountant(self): + super(PosConfig, self)._compute_is_installed_account_accountant() + for pos_config in self: + pos_config.is_installed_account_accountant = True diff --git a/pos_config_show_accounting/readme/CONTRIBUTORS.rst b/pos_config_show_accounting/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000..6860affe --- /dev/null +++ b/pos_config_show_accounting/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* Jordi Ballester Alomar diff --git a/pos_config_show_accounting/readme/DESCRIPTION.rst b/pos_config_show_accounting/readme/DESCRIPTION.rst new file mode 100644 index 00000000..df406a76 --- /dev/null +++ b/pos_config_show_accounting/readme/DESCRIPTION.rst @@ -0,0 +1,4 @@ +This module allows to show the accounting settings in the POS Configuration +when the accounting module is installed. As of Odoo 11, it would only be +visible when the Account Accountant module is installed, but this module +is available in Enterprise only. diff --git a/pos_config_show_accounting/readme/USAGE.rst b/pos_config_show_accounting/readme/USAGE.rst new file mode 100644 index 00000000..98905660 --- /dev/null +++ b/pos_config_show_accounting/readme/USAGE.rst @@ -0,0 +1,3 @@ +* Go to *Point of Sale / Configuration / Point of Sale* +* Create a new config or open an existing one +* You should now see the section *Accounting* diff --git a/pos_config_show_accounting/static/description/icon.png b/pos_config_show_accounting/static/description/icon.png new file mode 100644 index 00000000..3a0328b5 Binary files /dev/null and b/pos_config_show_accounting/static/description/icon.png differ diff --git a/pos_config_show_accounting/tests/__init__.py b/pos_config_show_accounting/tests/__init__.py new file mode 100644 index 00000000..1e0cf46a --- /dev/null +++ b/pos_config_show_accounting/tests/__init__.py @@ -0,0 +1 @@ +from . import test_pos_config_show_accounting diff --git a/pos_config_show_accounting/tests/test_pos_config_show_accounting.py b/pos_config_show_accounting/tests/test_pos_config_show_accounting.py new file mode 100644 index 00000000..75e41767 --- /dev/null +++ b/pos_config_show_accounting/tests/test_pos_config_show_accounting.py @@ -0,0 +1,14 @@ +# Copyright 2018 Eficent Business and IT Consulting Services, S.L. +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). + +from odoo.tests.common import TransactionCase + + +class TestPosConfigShowAccounting(TransactionCase): + def setUp(self): + super(TestPosConfigShowAccounting, self).setUp() + + def test_show_accounting(self): + pos_config = self.env['pos.config'].create( + {'name': 'PoS config show accounting'}) + self.assertEquals(pos_config.is_installed_account_accountant, True)