diff --git a/account_template_active/README.rst b/account_template_active/README.rst new file mode 100644 index 00000000..42115380 --- /dev/null +++ b/account_template_active/README.rst @@ -0,0 +1,127 @@ +============================== +Disable Account Template Items +============================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! 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%2Faccount--financial--tools-lightgray.png?logo=github + :target: https://github.com/OCA/account-financial-tools/tree/14.0/account_template_active + :alt: OCA/account-financial-tools +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/account-financial-tools-14-0/account-financial-tools-14-0-account_template_active + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/92/14.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module allows to disable account template items, adding +an ``active`` field on the following models: + +* ``account.account.template`` + +.. figure:: https://raw.githubusercontent.com/OCA/account-financial-tools/14.0/account_template_active/static/description/account_account_template_tree.png + +* ``account.fiscal.position.template`` and it two related models + * ``account.fiscal.position.account.template`` + * ``account.fiscal.position.tax.template`` + +.. figure:: https://raw.githubusercontent.com/OCA/account-financial-tools/14.0/account_template_active/static/description/account_fiscal_position_template_form.png + +This module can be interesting in a multi company context, +if you install a lot of accounting templates, with some changes. + +It can also be interesting if you want to developp a custom localization +module based on the official one, but with some removed / added / altered items. + +**Note:** + +* The field ``active`` is present in the Odoo ``account`` module for the model + ``account.tax.template``. for that field, this module only adds the ``active`` + field on the tree view. + +.. figure:: https://raw.githubusercontent.com/OCA/account-financial-tools/14.0/account_template_active/static/description/account_tax_template_tree.png + +For consistency reason, + +* if user disables an ``account.account.template`` it will disable the related + ``account.fiscal.position.account.template`` + +* if user disables an ``account.tax.template`` it will disable the related + ``account.fiscal.position.tax.template`` + +* if user enables an ``account.fiscal.position.account.template`` it will enable the + related ``account.account.template`` + +* if user enables an ``account.fiscal.position.tax.template`` it will enable the + related ``account.tax.template`` + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +* Go to Configuration > Templates +* Select then the template you want to change. + +Bug Tracker +=========== + +Bugs are tracked on `GitHub 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 `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* GRAP + +Contributors +~~~~~~~~~~~~ + +* Sylvain LE GAL +* Stefan Rijnhart + +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. + +.. |maintainer-legalsylvain| image:: https://github.com/legalsylvain.png?size=40px + :target: https://github.com/legalsylvain + :alt: legalsylvain + +Current `maintainer `__: + +|maintainer-legalsylvain| + +This module is part of the `OCA/account-financial-tools `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/account_template_active/__init__.py b/account_template_active/__init__.py new file mode 100644 index 00000000..0650744f --- /dev/null +++ b/account_template_active/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/account_template_active/__manifest__.py b/account_template_active/__manifest__.py new file mode 100644 index 00000000..ab391343 --- /dev/null +++ b/account_template_active/__manifest__.py @@ -0,0 +1,24 @@ +# Copyright (C) 2019 - Today: GRAP (http://www.grap.coop) +# @author: Sylvain LE GAL (https://twitter.com/legalsylvain) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +{ + "name": "Disable Account Template Items", + "version": "16.0.1.0.0", + "category": "Accounting", + "license": "AGPL-3", + "summary": "Allow to disable / enable account template items" + " (tax, fiscal position, account)", + "author": "GRAP, Odoo Community Association (OCA)", + "maintainers": ["legalsylvain"], + "website": "https://github.com/OCA/account-financial-tools", + "depends": [ + "account_usability", + ], + "data": [ + "views/view_account_account_template.xml", + "views/view_account_fiscal_position_template.xml", + "views/view_account_tax_template.xml", + ], + "installable": True, +} diff --git a/account_template_active/i18n/account_template_active.pot b/account_template_active/i18n/account_template_active.pot new file mode 100644 index 00000000..3d6a4eba --- /dev/null +++ b/account_template_active/i18n/account_template_active.pot @@ -0,0 +1,56 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_template_active +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2022-11-03 22:54+0000\n" +"PO-Revision-Date: 2022-11-03 22:54+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: account_template_active +#: model:ir.model,name:account_template_active.model_account_fiscal_position_account_template +msgid "Accounts Mapping Template of Fiscal Position" +msgstr "" + +#. module: account_template_active +#: model:ir.model.fields,field_description:account_template_active.field_account_account_template__active +#: model:ir.model.fields,field_description:account_template_active.field_account_fiscal_position_account_template__active +#: model:ir.model.fields,field_description:account_template_active.field_account_fiscal_position_tax_template__active +#: model:ir.model.fields,field_description:account_template_active.field_account_fiscal_position_template__active +msgid "Active" +msgstr "" + +#. module: account_template_active +#: model_terms:ir.ui.view,arch_db:account_template_active.view_account_fiscal_position_template_form +#: model_terms:ir.ui.view,arch_db:account_template_active.view_account_tax_template_form +#: model_terms:ir.ui.view,arch_db:account_template_active.view_account_template_form +msgid "Archived" +msgstr "" + +#. module: account_template_active +#: model:ir.model,name:account_template_active.model_account_fiscal_position_tax_template +msgid "Tax Mapping Template of Fiscal Position" +msgstr "" + +#. module: account_template_active +#: model:ir.model,name:account_template_active.model_account_fiscal_position_template +msgid "Template for Fiscal Position" +msgstr "" + +#. module: account_template_active +#: model:ir.model,name:account_template_active.model_account_account_template +msgid "Templates for Accounts" +msgstr "" + +#. module: account_template_active +#: model:ir.model,name:account_template_active.model_account_tax_template +msgid "Templates for Taxes" +msgstr "" \ No newline at end of file diff --git a/account_template_active/i18n/fr.po b/account_template_active/i18n/fr.po new file mode 100644 index 00000000..d20183d2 --- /dev/null +++ b/account_template_active/i18n/fr.po @@ -0,0 +1,56 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_template_active +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2022-11-03 22:52+0000\n" +"PO-Revision-Date: 2022-11-03 22:52+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: account_template_active +#: model:ir.model,name:account_template_active.model_account_fiscal_position_account_template +msgid "Accounts Mapping Template of Fiscal Position" +msgstr "Modèle de mapping de compte de position fiscale" + +#. module: account_template_active +#: model:ir.model.fields,field_description:account_template_active.field_account_account_template__active +#: model:ir.model.fields,field_description:account_template_active.field_account_fiscal_position_account_template__active +#: model:ir.model.fields,field_description:account_template_active.field_account_fiscal_position_tax_template__active +#: model:ir.model.fields,field_description:account_template_active.field_account_fiscal_position_template__active +msgid "Active" +msgstr "Actif" + +#. module: account_template_active +#: model_terms:ir.ui.view,arch_db:account_template_active.view_account_fiscal_position_template_form +#: model_terms:ir.ui.view,arch_db:account_template_active.view_account_tax_template_form +#: model_terms:ir.ui.view,arch_db:account_template_active.view_account_template_form +msgid "Archived" +msgstr "Archivé·e" + +#. module: account_template_active +#: model:ir.model,name:account_template_active.model_account_fiscal_position_tax_template +msgid "Tax Mapping Template of Fiscal Position" +msgstr "Modèle de mapping de taxe de position fiscale" + +#. module: account_template_active +#: model:ir.model,name:account_template_active.model_account_fiscal_position_template +msgid "Template for Fiscal Position" +msgstr "Modèle de position fiscale" + +#. module: account_template_active +#: model:ir.model,name:account_template_active.model_account_account_template +msgid "Templates for Accounts" +msgstr "Modèles pour les comptes" + +#. module: account_template_active +#: model:ir.model,name:account_template_active.model_account_tax_template +msgid "Templates for Taxes" +msgstr "Modèles pour les taxes" diff --git a/account_template_active/models/__init__.py b/account_template_active/models/__init__.py new file mode 100644 index 00000000..98635963 --- /dev/null +++ b/account_template_active/models/__init__.py @@ -0,0 +1,5 @@ +from . import account_account_template +from . import account_fiscal_position_account_template +from . import account_fiscal_position_tax_template +from . import account_fiscal_position_template +from . import account_tax_template diff --git a/account_template_active/models/account_account_template.py b/account_template_active/models/account_account_template.py new file mode 100644 index 00000000..990142c7 --- /dev/null +++ b/account_template_active/models/account_account_template.py @@ -0,0 +1,26 @@ +# Copyright (C) 2015 - Today: GRAP (http://www.grap.coop) +# @author: Sylvain LE GAL (https://twitter.com/legalsylvain) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import fields, models + + +class AccountAccountTemplate(models.Model): + _inherit = "account.account.template" + + active = fields.Boolean(default=True) + + def write(self, vals): + FpaTemplate = self.env["account.fiscal.position.account.template"] + if "active" in vals and not vals.get("active"): + # Disable account.account.template should disable + # account.fiscal.position.account.template associated + fpaTemplates = FpaTemplate.search( + [ + "|", + ("account_src_id", "in", self.ids), + ("account_dest_id", "in", self.ids), + ] + ) + fpaTemplates.write({"active": False}) + return super().write(vals) diff --git a/account_template_active/models/account_fiscal_position_account_template.py b/account_template_active/models/account_fiscal_position_account_template.py new file mode 100644 index 00000000..e49a210d --- /dev/null +++ b/account_template_active/models/account_fiscal_position_account_template.py @@ -0,0 +1,23 @@ +# Copyright (C) 2018-Today GRAP (http://www.grap.coop) +# @author: Sylvain LE GAL (https://twitter.com/legalsylvain) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import fields, models + + +class AccountFiscalPositionAccountTemplate(models.Model): + _inherit = "account.fiscal.position.account.template" + + active = fields.Boolean(default=True) + + def write(self, vals): + AccountTemplate = self.env["account.account.template"] + if vals.get("active", False): + # enable account.fiscal.position.account.template should enable + # related account.account.template + account_ids = set( + self.mapped("account_src_id").ids + self.mapped("account_dest_id").ids + ) + accountTemplates = AccountTemplate.browse(account_ids) + accountTemplates.write({"active": True}) + return super().write(vals) diff --git a/account_template_active/models/account_fiscal_position_tax_template.py b/account_template_active/models/account_fiscal_position_tax_template.py new file mode 100644 index 00000000..48ccb2f6 --- /dev/null +++ b/account_template_active/models/account_fiscal_position_tax_template.py @@ -0,0 +1,23 @@ +# Copyright (C) 2019-Today GRAP (http://www.grap.coop) +# @author: Sylvain LE GAL (https://twitter.com/legalsylvain) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import fields, models + + +class AccountFiscalPositionTaxTemplate(models.Model): + _inherit = "account.fiscal.position.tax.template" + + active = fields.Boolean(default=True) + + def write(self, vals): + TaxTemplate = self.env["account.tax.template"] + if vals.get("active", False): + # enable account.fiscal.position.tax.template should enable + # related account.tax.template + tax_ids = set( + self.mapped("tax_src_id").ids + self.mapped("tax_dest_id").ids + ) + taxTemplates = TaxTemplate.browse(tax_ids) + taxTemplates.write({"active": True}) + return super().write(vals) diff --git a/account_template_active/models/account_fiscal_position_template.py b/account_template_active/models/account_fiscal_position_template.py new file mode 100644 index 00000000..71fc504d --- /dev/null +++ b/account_template_active/models/account_fiscal_position_template.py @@ -0,0 +1,11 @@ +# Copyright (C) 2019-Today GRAP (http://www.grap.coop) +# @author: Sylvain LE GAL (https://twitter.com/legalsylvain) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import fields, models + + +class AccountFiscalPositionTemplate(models.Model): + _inherit = "account.fiscal.position.template" + + active = fields.Boolean(default=True) diff --git a/account_template_active/models/account_tax_template.py b/account_template_active/models/account_tax_template.py new file mode 100644 index 00000000..f3e001af --- /dev/null +++ b/account_template_active/models/account_tax_template.py @@ -0,0 +1,24 @@ +# Copyright (C) 2020 - Today: GRAP (http://www.grap.coop) +# @author: Sylvain LE GAL (https://twitter.com/legalsylvain) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import models + + +class AccountTaxTemplate(models.Model): + _inherit = "account.tax.template" + + def write(self, vals): + FptTemplate = self.env["account.fiscal.position.tax.template"] + if "active" in vals and not vals.get("active"): + # Disable account.tax.template should disable + # account.fiscal.position.tax.template associated + fptTemplates = FptTemplate.search( + [ + "|", + ("tax_src_id", "in", self.ids), + ("tax_dest_id", "in", self.ids), + ] + ) + fptTemplates.write({"active": False}) + return super().write(vals) diff --git a/account_template_active/readme/CONTRIBUTORS.rst b/account_template_active/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000..5e80541d --- /dev/null +++ b/account_template_active/readme/CONTRIBUTORS.rst @@ -0,0 +1,2 @@ +* Sylvain LE GAL +* Stefan Rijnhart diff --git a/account_template_active/readme/DESCRIPTION.rst b/account_template_active/readme/DESCRIPTION.rst new file mode 100644 index 00000000..219e706e --- /dev/null +++ b/account_template_active/readme/DESCRIPTION.rst @@ -0,0 +1,40 @@ +This module allows to disable account template items, adding +an ``active`` field on the following models: + +* ``account.account.template`` + +.. figure:: ../static/description/account_account_template_tree.png + +* ``account.fiscal.position.template`` and it two related models + * ``account.fiscal.position.account.template`` + * ``account.fiscal.position.tax.template`` + +.. figure:: ../static/description/account_fiscal_position_template_form.png + +This module can be interesting in a multi company context, +if you install a lot of accounting templates, with some changes. + +It can also be interesting if you want to developp a custom localization +module based on the official one, but with some removed / added / altered items. + +**Note:** + +* The field ``active`` is present in the Odoo ``account`` module for the model + ``account.tax.template``. for that field, this module only adds the ``active`` + field on the tree view. + +.. figure:: ../static/description/account_tax_template_tree.png + +For consistency reason, + +* if user disables an ``account.account.template`` it will disable the related + ``account.fiscal.position.account.template`` + +* if user disables an ``account.tax.template`` it will disable the related + ``account.fiscal.position.tax.template`` + +* if user enables an ``account.fiscal.position.account.template`` it will enable the + related ``account.account.template`` + +* if user enables an ``account.fiscal.position.tax.template`` it will enable the + related ``account.tax.template`` diff --git a/account_template_active/readme/USAGE.rst b/account_template_active/readme/USAGE.rst new file mode 100644 index 00000000..25e6ba53 --- /dev/null +++ b/account_template_active/readme/USAGE.rst @@ -0,0 +1,2 @@ +* Go to Accounting > Configuration > Templates +* Select then the template you want to change. diff --git a/account_template_active/static/description/account_account_template_tree.png b/account_template_active/static/description/account_account_template_tree.png new file mode 100644 index 00000000..451c904f Binary files /dev/null and b/account_template_active/static/description/account_account_template_tree.png differ diff --git a/account_template_active/static/description/account_fiscal_position_template_form.png b/account_template_active/static/description/account_fiscal_position_template_form.png new file mode 100644 index 00000000..b2f9e283 Binary files /dev/null and b/account_template_active/static/description/account_fiscal_position_template_form.png differ diff --git a/account_template_active/static/description/account_tax_template_tree.png b/account_template_active/static/description/account_tax_template_tree.png new file mode 100644 index 00000000..452f0b4d Binary files /dev/null and b/account_template_active/static/description/account_tax_template_tree.png differ diff --git a/account_template_active/static/description/icon.png b/account_template_active/static/description/icon.png new file mode 100644 index 00000000..3a0328b5 Binary files /dev/null and b/account_template_active/static/description/icon.png differ diff --git a/account_template_active/static/description/index.html b/account_template_active/static/description/index.html new file mode 100644 index 00000000..ef758325 --- /dev/null +++ b/account_template_active/static/description/index.html @@ -0,0 +1,475 @@ + + + + + + +Disable Account Template Items + + + +
+

Disable Account Template Items

+ + +

Beta License: AGPL-3 OCA/account-financial-tools Translate me on Weblate Try me on Runbot

+

This module allows to disable account template items, adding +an active field on the following models:

+
    +
  • account.account.template
  • +
+
+https://raw.githubusercontent.com/OCA/account-financial-tools/14.0/account_template_active/static/description/account_account_template_tree.png +
+
    +
  • +
    account.fiscal.position.template and it two related models
    +
      +
    • account.fiscal.position.account.template
    • +
    • account.fiscal.position.tax.template
    • +
    +
    +
    +
  • +
+
+https://raw.githubusercontent.com/OCA/account-financial-tools/14.0/account_template_active/static/description/account_fiscal_position_template_form.png +
+

This module can be interesting in a multi company context, +if you install a lot of accounting templates, with some changes.

+

It can also be interesting if you want to developp a custom localization +module based on the official one, but with some removed / added / altered items.

+

Note:

+
    +
  • The field active is present in the Odoo account module for the model +account.tax.template. for that field, this module only adds the active +field on the tree view.
  • +
+
+https://raw.githubusercontent.com/OCA/account-financial-tools/14.0/account_template_active/static/description/account_tax_template_tree.png +
+

For consistency reason,

+
    +
  • if user disables an account.account.template it will disable the related +account.fiscal.position.account.template
  • +
  • if user disables an account.tax.template it will disable the related +account.fiscal.position.tax.template
  • +
  • if user enables an account.fiscal.position.account.template it will enable the +related account.account.template
  • +
  • if user enables an account.fiscal.position.tax.template it will enable the +related account.tax.template
  • +
+

Table of contents

+ +
+

Usage

+
    +
  • Go to Configuration > Templates
  • +
  • Select then the template you want to change.
  • +
+
+
+

Bug Tracker

+

Bugs are tracked on GitHub 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.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • GRAP
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

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.

+

Current maintainer:

+

legalsylvain

+

This module is part of the OCA/account-financial-tools project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/account_template_active/tests/__init__.py b/account_template_active/tests/__init__.py new file mode 100644 index 00000000..d9b96c4f --- /dev/null +++ b/account_template_active/tests/__init__.py @@ -0,0 +1 @@ +from . import test_module diff --git a/account_template_active/tests/test_module.py b/account_template_active/tests/test_module.py new file mode 100644 index 00000000..da8c8a72 --- /dev/null +++ b/account_template_active/tests/test_module.py @@ -0,0 +1,91 @@ +# Copyright (C) 2020 - Today: GRAP (http://www.grap.coop) +# @author: Sylvain LE GAL (https://twitter.com/legalsylvain) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo.tests.common import TransactionCase + + +class TestModule(TransactionCase): + def setUp(self): + super().setUp() + self.ACTemplate = self.env["account.chart.template"] + self.AATemplate = self.env["account.account.template"] + self.ATTemplate = self.env["account.tax.template"] + self.AFPTemplate = self.env["account.fiscal.position.template"] + self.AFPATemplate = self.env["account.fiscal.position.account.template"] + self.AFPTTemplate = self.env["account.fiscal.position.tax.template"] + + self.template = self.ACTemplate.create( + { + "name": "Chart of Account", + "bank_account_code_prefix": "BNK", + "cash_account_code_prefix": "CSH", + "transfer_account_code_prefix": "TRSF", + "currency_id": self.env.ref("base.EUR").id, + } + ) + + self.account_template = self.AATemplate.create( + { + "name": "Account Template", + "code": "CODE", + "account_type": "asset_receivable", + "chart_template_id": self.template.id, + } + ) + self.tax_template = self.ATTemplate.create( + { + "name": "Tax Template", + "chart_template_id": self.template.id, + "amount": 10.0, + } + ) + self.fiscal_position = self.AFPTemplate.create( + { + "name": "Fiscal Position", + "chart_template_id": self.template.id, + } + ) + self.fiscal_position_account = self.AFPATemplate.create( + { + "account_src_id": self.account_template.id, + "account_dest_id": self.account_template.id, + "position_id": self.fiscal_position.id, + } + ) + self.fiscal_position_tax = self.AFPTTemplate.create( + { + "tax_src_id": self.tax_template.id, + "position_id": self.fiscal_position.id, + } + ) + + def test_tax_template(self): + self.tax_template.active = False + self.assertEqual( + self.fiscal_position_tax.active, + False, + "Disable Tax template should disable Fiscal Position Tax", + ) + + self.fiscal_position_tax.active = True + self.assertEqual( + self.tax_template.active, + True, + "Enable Fiscal Position Tax should enable Tax Template", + ) + + def test_account_template(self): + self.account_template.active = False + self.assertEqual( + self.fiscal_position_account.active, + False, + "Disable Account template should disable Fiscal Position Account", + ) + + self.fiscal_position_account.active = True + self.assertEqual( + self.account_template.active, + True, + "Enable Fiscal Position Account should enable Account Template", + ) diff --git a/account_template_active/views/view_account_account_template.xml b/account_template_active/views/view_account_account_template.xml new file mode 100644 index 00000000..5d68cb40 --- /dev/null +++ b/account_template_active/views/view_account_account_template.xml @@ -0,0 +1,54 @@ + + + + + + account.account.template + + + + not active + + + + + + + + + account.account.template + + + + + + + + + + + + + {"active_test": False} + + + diff --git a/account_template_active/views/view_account_fiscal_position_template.xml b/account_template_active/views/view_account_fiscal_position_template.xml new file mode 100644 index 00000000..55d02a4e --- /dev/null +++ b/account_template_active/views/view_account_fiscal_position_template.xml @@ -0,0 +1,75 @@ + + + + + + account.fiscal.position.template + + + + not active + + + + + + + + + account.fiscal.position.template + + + + + + + + + + not active + + + + + + + + + + + + + + + + + + {"active_test": False} + + + diff --git a/account_template_active/views/view_account_tax_template.xml b/account_template_active/views/view_account_tax_template.xml new file mode 100644 index 00000000..759ca30a --- /dev/null +++ b/account_template_active/views/view_account_tax_template.xml @@ -0,0 +1,44 @@ + + + + + + account.tax.template + + + + not active + + + + + + + + + account.tax.template + + + + + + + + + + + + + {"active_test": False} + + + diff --git a/setup/account_template_active/odoo/addons/account_template_active b/setup/account_template_active/odoo/addons/account_template_active new file mode 120000 index 00000000..b7de708f --- /dev/null +++ b/setup/account_template_active/odoo/addons/account_template_active @@ -0,0 +1 @@ +../../../../account_template_active \ No newline at end of file diff --git a/setup/account_template_active/setup.py b/setup/account_template_active/setup.py new file mode 100644 index 00000000..28c57bb6 --- /dev/null +++ b/setup/account_template_active/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)