Browse Source

[ADD][pos_config_show_accounting]

pull/313/head
Jordi Ballester Alomar 6 years ago
parent
commit
e4cbc00bad
  1. 1
      pos_config_show_accounting/__init__.py
  2. 17
      pos_config_show_accounting/__manifest__.py
  3. 1
      pos_config_show_accounting/models/__init__.py
  4. 16
      pos_config_show_accounting/models/pos_config.py
  5. 1
      pos_config_show_accounting/readme/CONTRIBUTORS.rst
  6. 4
      pos_config_show_accounting/readme/DESCRIPTION.rst
  7. 3
      pos_config_show_accounting/readme/USAGE.rst
  8. BIN
      pos_config_show_accounting/static/description/icon.png
  9. 1
      pos_config_show_accounting/tests/__init__.py
  10. 14
      pos_config_show_accounting/tests/test_pos_config_show_accounting.py

1
pos_config_show_accounting/__init__.py

@ -0,0 +1 @@
from . import models

17
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,
}

1
pos_config_show_accounting/models/__init__.py

@ -0,0 +1 @@
from . import pos_config

16
pos_config_show_accounting/models/pos_config.py

@ -0,0 +1,16 @@
# Copyright 2018 Eficent <https://www.eficent.com/>
# 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

1
pos_config_show_accounting/readme/CONTRIBUTORS.rst

@ -0,0 +1 @@
* Jordi Ballester Alomar <jordi.ballester@eficent.com>

4
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.

3
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*

BIN
pos_config_show_accounting/static/description/icon.png

After

Width: 128  |  Height: 128  |  Size: 9.2 KiB

1
pos_config_show_accounting/tests/__init__.py

@ -0,0 +1 @@
from . import test_pos_config_show_accounting

14
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)
Loading…
Cancel
Save