diff --git a/account_fiscal_position_tax_included/README.rst b/account_fiscal_position_tax_included/README.rst new file mode 100644 index 000000000..179d1cc74 --- /dev/null +++ b/account_fiscal_position_tax_included/README.rst @@ -0,0 +1,99 @@ +================================================== +Account Fiscal Position - Tax Excluded to Included +================================================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:72f4c03f47c69856c81e1cdd6f1043f489bb8e0d322edf5ceb1054e37364e26e + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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--fiscal--rule-lightgray.png?logo=github + :target: https://github.com/OCA/account-fiscal-rule/tree/16.0/account_fiscal_position_tax_included + :alt: OCA/account-fiscal-rule +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/account-fiscal-rule-16-0/account-fiscal-rule-16-0-account_fiscal_position_tax_included + :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/account-fiscal-rule&target_branch=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module extend the Odoo account module, regarding fiscal position. + +By default, it is only possible to realize such tax mapping : + +* Tax Excl --> Tax Excl / No tax +* Tax Incl --> Tax Excl / No tax +* Tax Incl --> Tax Incl / No tax + +This module allows to realize such mapping and fixes incorrect computation. + +* Tax Excl --> Tax Incl + +**Table of contents** + +.. contents:: + :local: + +Development +=========== + +This module fully overwrite the function ``_get_tax_included_unit_price_from_price`` of the model ``product.product``. + +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 to smash 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 + +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-fiscal-rule `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/account_fiscal_position_tax_included/__init__.py b/account_fiscal_position_tax_included/__init__.py new file mode 100644 index 000000000..0650744f6 --- /dev/null +++ b/account_fiscal_position_tax_included/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/account_fiscal_position_tax_included/__manifest__.py b/account_fiscal_position_tax_included/__manifest__.py new file mode 100644 index 000000000..60da4e1c3 --- /dev/null +++ b/account_fiscal_position_tax_included/__manifest__.py @@ -0,0 +1,20 @@ +# Copyright (C) 2019-Today Sylvain LE GAL (http://www.grap.coop) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +{ + "name": "Account Fiscal Position - Tax Excluded to Included", + "summary": "Allow to map from tax excluded to tax included", + "version": "16.0.1.0.0", + "category": "Accounting", + "author": "GRAP, Odoo Community Association (OCA)", + "maintainers": ["legalsylvain"], + "website": "https://github.com/OCA/account-fiscal-rule", + "license": "AGPL-3", + "depends": ["account"], + "demo": [ + "demo/account_tax.xml", + "demo/account_fiscal_position.xml", + "demo/product_product.xml", + ], + "installable": True, +} diff --git a/account_fiscal_position_tax_included/demo/account_fiscal_position.xml b/account_fiscal_position_tax_included/demo/account_fiscal_position.xml new file mode 100644 index 000000000..ba3c52b17 --- /dev/null +++ b/account_fiscal_position_tax_included/demo/account_fiscal_position.xml @@ -0,0 +1,60 @@ + + + + + + 20% Tax Excl. -> 20% Tax Incl. + + + + + + + + + + 20% Tax Excl. -> 5% Tax Excl. + + + + + + + + + + 20% Tax Incl. -> 20% Tax Excl. + + + + + + + + + + 20% Tax Incl. -> 5% Tax Incl. + + + + + + + + + diff --git a/account_fiscal_position_tax_included/demo/account_tax.xml b/account_fiscal_position_tax_included/demo/account_tax.xml new file mode 100644 index 000000000..1b5501f4f --- /dev/null +++ b/account_fiscal_position_tax_included/demo/account_tax.xml @@ -0,0 +1,36 @@ + + + + + + 5% Tax Excl + percent + 5 + + + + + 20% Tax Excl + percent + 20 + + + + + 5% Tax Incl + percent + 5 + + + + + 20% Tax Incl + percent + 20 + + + + diff --git a/account_fiscal_position_tax_included/demo/product_product.xml b/account_fiscal_position_tax_included/demo/product_product.xml new file mode 100644 index 000000000..c81183183 --- /dev/null +++ b/account_fiscal_position_tax_included/demo/product_product.xml @@ -0,0 +1,20 @@ + + + + + + Product 20% Tax Excl. (100 Vat Excl / 120 Vat Incl) + + 100 + + + + Product 20% Tax Incl. (100 Vat Excl / 120 Vat Incl) + + 120 + + + diff --git a/account_fiscal_position_tax_included/i18n/fr.po b/account_fiscal_position_tax_included/i18n/fr.po new file mode 100644 index 000000000..d41c75cb4 --- /dev/null +++ b/account_fiscal_position_tax_included/i18n/fr.po @@ -0,0 +1,50 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_fiscal_position_tax_included +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-11-14 13:26+0000\n" +"PO-Revision-Date: 2019-11-14 13:26+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_fiscal_position_tax_included +#: model:product.product,name:account_fiscal_position_tax_included.product_20_tax_excl +#: model:product.template,name:account_fiscal_position_tax_included.product_20_tax_excl_product_template +msgid "Product 20% Tax Excl." +msgstr "Produit TVA 20% (HT)" + +#. module: account_fiscal_position_tax_included +#: model:product.product,name:account_fiscal_position_tax_included.product_20_tax_incl +#: model:product.template,name:account_fiscal_position_tax_included.product_20_tax_incl_product_template +msgid "Product 20% Tax Incl." +msgstr "Produit TVA 20% (TTC)" + +#. module: account_fiscal_position_tax_included +#: model:ir.model,name:account_fiscal_position_tax_included.model_account_tax +msgid "Tax" +msgstr "Taxe" + +#. module: account_fiscal_position_tax_included +#: model:product.product,uom_name:account_fiscal_position_tax_included.product_20_tax_excl +#: model:product.product,uom_name:account_fiscal_position_tax_included.product_20_tax_incl +#: model:product.template,uom_name:account_fiscal_position_tax_included.product_20_tax_excl_product_template +#: model:product.template,uom_name:account_fiscal_position_tax_included.product_20_tax_incl_product_template +msgid "Unit(s)" +msgstr "Unité(s)" + +#. module: account_fiscal_position_tax_included +#: model:product.product,weight_uom_name:account_fiscal_position_tax_included.product_20_tax_excl +#: model:product.product,weight_uom_name:account_fiscal_position_tax_included.product_20_tax_incl +#: model:product.template,weight_uom_name:account_fiscal_position_tax_included.product_20_tax_excl_product_template +#: model:product.template,weight_uom_name:account_fiscal_position_tax_included.product_20_tax_incl_product_template +msgid "kg" +msgstr "kg" + diff --git a/account_fiscal_position_tax_included/models/__init__.py b/account_fiscal_position_tax_included/models/__init__.py new file mode 100644 index 000000000..5c74c8c30 --- /dev/null +++ b/account_fiscal_position_tax_included/models/__init__.py @@ -0,0 +1 @@ +from . import product_product diff --git a/account_fiscal_position_tax_included/models/product_product.py b/account_fiscal_position_tax_included/models/product_product.py new file mode 100644 index 000000000..16033f31e --- /dev/null +++ b/account_fiscal_position_tax_included/models/product_product.py @@ -0,0 +1,72 @@ +# Copyright (C) 2019 - Today: Sylvain LE GAL (http://www.grap.coop) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import api, models + + +class ProductProduct(models.Model): + _inherit = "product.product" + + # Full Copy Paste of the original function, defined in the odoo account module. + # One single line is changed + @api.model + def _get_tax_included_unit_price_from_price( + self, + product_price_unit, + currency, + product_taxes, + fiscal_position=None, + product_taxes_after_fp=None, + is_refund_document=False, + ): + if not product_taxes: + return product_price_unit + + if product_taxes_after_fp is None: + if not fiscal_position: + return product_price_unit + + product_taxes_after_fp = fiscal_position.map_tax(product_taxes) + + flattened_taxes_after_fp = ( + product_taxes_after_fp._origin.flatten_taxes_hierarchy() + ) + flattened_taxes_before_fp = product_taxes._origin.flatten_taxes_hierarchy() + + # + # taxes_before_included = all(tax.price_include for tax in flattened_taxes_before_fp) + taxes_before_included = True + # + + if ( + set(product_taxes.ids) != set(product_taxes_after_fp.ids) + and taxes_before_included + ): + taxes_res = flattened_taxes_before_fp.with_context( + round=False, round_base=False + ).compute_all( + product_price_unit, + quantity=1.0, + currency=currency, + product=self, + is_refund=is_refund_document, + ) + product_price_unit = taxes_res["total_excluded"] + + if any(tax.price_include for tax in flattened_taxes_after_fp): + taxes_res = flattened_taxes_after_fp.with_context( + round=False, round_base=False + ).compute_all( + product_price_unit, + quantity=1.0, + currency=currency, + product=self, + is_refund=is_refund_document, + handle_price_include=False, + ) + for tax_res in taxes_res["taxes"]: + tax = self.env["account.tax"].browse(tax_res["id"]) + if tax.price_include: + product_price_unit += tax_res["amount"] + + return product_price_unit diff --git a/account_fiscal_position_tax_included/readme/CONTRIBUTORS.rst b/account_fiscal_position_tax_included/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..9f76a75bc --- /dev/null +++ b/account_fiscal_position_tax_included/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* Sylvain LE GAL diff --git a/account_fiscal_position_tax_included/readme/DESCRIPTION.rst b/account_fiscal_position_tax_included/readme/DESCRIPTION.rst new file mode 100644 index 000000000..5f131a85d --- /dev/null +++ b/account_fiscal_position_tax_included/readme/DESCRIPTION.rst @@ -0,0 +1,11 @@ +This module extend the Odoo account module, regarding fiscal position. + +By default, it is only possible to realize such tax mapping : + +* Tax Excl --> Tax Excl / No tax +* Tax Incl --> Tax Excl / No tax +* Tax Incl --> Tax Incl / No tax + +This module allows to realize such mapping and fixes incorrect computation. + +* Tax Excl --> Tax Incl diff --git a/account_fiscal_position_tax_included/readme/DEVELOP.rst b/account_fiscal_position_tax_included/readme/DEVELOP.rst new file mode 100644 index 000000000..5bfe6e5c2 --- /dev/null +++ b/account_fiscal_position_tax_included/readme/DEVELOP.rst @@ -0,0 +1 @@ +This module fully overwrite the function ``_get_tax_included_unit_price_from_price`` of the model ``product.product``. diff --git a/account_fiscal_position_tax_included/static/description/index.html b/account_fiscal_position_tax_included/static/description/index.html new file mode 100644 index 000000000..d4a0bfffd --- /dev/null +++ b/account_fiscal_position_tax_included/static/description/index.html @@ -0,0 +1,440 @@ + + + + + +Account Fiscal Position - Tax Excluded to Included + + + +
+

Account Fiscal Position - Tax Excluded to Included

+ + +

Beta License: AGPL-3 OCA/account-fiscal-rule Translate me on Weblate Try me on Runboat

+

This module extend the Odoo account module, regarding fiscal position.

+

By default, it is only possible to realize such tax mapping :

+
    +
  • Tax Excl –> Tax Excl / No tax
  • +
  • Tax Incl –> Tax Excl / No tax
  • +
  • Tax Incl –> Tax Incl / No tax
  • +
+

This module allows to realize such mapping and fixes incorrect computation.

+
    +
  • Tax Excl –> Tax Incl
  • +
+

Table of contents

+ +
+

Development

+

This module fully overwrite the function _get_tax_included_unit_price_from_price of the model product.product.

+
+
+

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 to smash it by providing a detailed and welcomed +feedback.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • GRAP
  • +
+
+ +
+

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-fiscal-rule project on GitHub.

+

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

+
+
+
+ + diff --git a/account_fiscal_position_tax_included/tests/__init__.py b/account_fiscal_position_tax_included/tests/__init__.py new file mode 100644 index 000000000..d9b96c4fa --- /dev/null +++ b/account_fiscal_position_tax_included/tests/__init__.py @@ -0,0 +1 @@ +from . import test_module diff --git a/account_fiscal_position_tax_included/tests/test_module.py b/account_fiscal_position_tax_included/tests/test_module.py new file mode 100644 index 000000000..05122614d --- /dev/null +++ b/account_fiscal_position_tax_included/tests/test_module.py @@ -0,0 +1,195 @@ +# Copyright (C) 2019 - Today: Sylvain LE GAL (http://www.grap.coop) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo.tests import Form +from odoo.tests.common import TransactionCase + + +class TestModule(TransactionCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.fiscal_position_20_excl_to_20_incl = cls.env.ref( + "account_fiscal_position_tax_included.fiscal_position_20_excl_to_20_incl" + ) + + cls.fiscal_position_20_excl_to_5_excl = cls.env.ref( + "account_fiscal_position_tax_included.fiscal_position_20_excl_to_5_excl" + ) + + cls.fiscal_position_20_incl_to_20_excl = cls.env.ref( + "account_fiscal_position_tax_included.fiscal_position_20_incl_to_20_excl" + ) + cls.fiscal_position_20_incl_to_5_incl = cls.env.ref( + "account_fiscal_position_tax_included.fiscal_position_20_incl_to_5_incl" + ) + + cls.product_20_tax_incl = cls.env.ref( + "account_fiscal_position_tax_included.product_20_tax_incl" + ) + + cls.product_20_tax_excl = cls.env.ref( + "account_fiscal_position_tax_included.product_20_tax_excl" + ) + + cls.tax_20_tax_excl = cls.env.ref( + "account_fiscal_position_tax_included.tax_20_tax_excl" + ) + cls.tax_5_tax_excl = cls.env.ref( + "account_fiscal_position_tax_included.tax_5_tax_excl" + ) + cls.tax_20_tax_incl = cls.env.ref( + "account_fiscal_position_tax_included.tax_20_tax_incl" + ) + cls.tax_5_tax_incl = cls.env.ref( + "account_fiscal_position_tax_included.tax_5_tax_incl" + ) + + cls.customer = cls.env["res.partner"].create({"name": "Customer"}) + + cls.invoice = cls.env["account.move"].create( + { + "move_type": "out_invoice", + "partner_id": cls.customer.id, + "fiscal_position_id": False, + "invoice_line_ids": [], + } + ) + + # ################################ + # Test Section "No Regression" (A) + # ################################ + + def test_00_no_fp_product_tax_excl(self): + invoice_form = Form(self.invoice) + with invoice_form.invoice_line_ids.new() as line: + line.product_id = self.product_20_tax_excl + invoice_form.save() + + self.assertEqual(self.invoice.invoice_line_ids[0].price_unit, 100) + self.assertEqual(self.invoice.invoice_line_ids[0].tax_ids, self.tax_20_tax_excl) + + self.assertEqual(self.invoice.amount_untaxed_signed, 100) + self.assertEqual(self.invoice.amount_total_signed, 120) + + def test_01_no_fp_product_tax_incl(self): + invoice_form = Form(self.invoice) + with invoice_form.invoice_line_ids.new() as line: + line.product_id = self.product_20_tax_incl + invoice_form.save() + + self.assertEqual(self.invoice.invoice_line_ids[0].price_unit, 120) + self.assertEqual(self.invoice.invoice_line_ids[0].tax_ids, self.tax_20_tax_incl) + + self.assertEqual(self.invoice.amount_untaxed_signed, 100) + self.assertEqual(self.invoice.amount_total_signed, 120) + + def test_10_ftp_incl_2_excl_product_tax_excl(self): + invoice_form = Form(self.invoice) + invoice_form.fiscal_position_id = self.fiscal_position_20_incl_to_20_excl + with invoice_form.invoice_line_ids.new() as line: + line.product_id = self.product_20_tax_excl + invoice_form.save() + + self.assertEqual(self.invoice.invoice_line_ids[0].price_unit, 100) + self.assertEqual(self.invoice.invoice_line_ids[0].tax_ids, self.tax_20_tax_excl) + + self.assertEqual(self.invoice.amount_untaxed_signed, 100) + self.assertEqual(self.invoice.amount_total_signed, 120) + + def test_11_ftp_incl_2_excl_product_tax_incl(self): + invoice_form = Form(self.invoice) + invoice_form.fiscal_position_id = self.fiscal_position_20_incl_to_20_excl + with invoice_form.invoice_line_ids.new() as line: + line.product_id = self.product_20_tax_incl + invoice_form.save() + + self.assertEqual(self.invoice.invoice_line_ids[0].price_unit, 100) + self.assertEqual(self.invoice.invoice_line_ids[0].tax_ids, self.tax_20_tax_excl) + + self.assertEqual(self.invoice.amount_untaxed_signed, 100) + self.assertEqual(self.invoice.amount_total_signed, 120) + + def test_21_ftp_excl_2_incl_product_tax_incl(self): + invoice_form = Form(self.invoice) + invoice_form.fiscal_position_id = self.fiscal_position_20_excl_to_20_incl + with invoice_form.invoice_line_ids.new() as line: + line.product_id = self.product_20_tax_incl + invoice_form.save() + + self.assertEqual(self.invoice.invoice_line_ids[0].price_unit, 120) + self.assertEqual(self.invoice.invoice_line_ids[0].tax_ids, self.tax_20_tax_incl) + + self.assertEqual(self.invoice.amount_untaxed_signed, 100) + self.assertEqual(self.invoice.amount_total_signed, 120) + + def test_30_ftp_excl_2_excl_product_tax_excl(self): + invoice_form = Form(self.invoice) + invoice_form.fiscal_position_id = self.fiscal_position_20_excl_to_5_excl + with invoice_form.invoice_line_ids.new() as line: + line.product_id = self.product_20_tax_excl + invoice_form.save() + + self.assertEqual(self.invoice.invoice_line_ids[0].price_unit, 100) + self.assertEqual(self.invoice.invoice_line_ids[0].tax_ids, self.tax_5_tax_excl) + + self.assertEqual(self.invoice.amount_untaxed_signed, 100) + self.assertEqual(self.invoice.amount_total_signed, 105) + + def test_31_ftp_excl_2_excl_product_tax_incl(self): + invoice_form = Form(self.invoice) + invoice_form.fiscal_position_id = self.fiscal_position_20_excl_to_5_excl + with invoice_form.invoice_line_ids.new() as line: + line.product_id = self.product_20_tax_incl + invoice_form.save() + + # Mapping should not be executed + self.assertEqual(self.invoice.invoice_line_ids[0].price_unit, 120) + self.assertEqual(self.invoice.invoice_line_ids[0].tax_ids, self.tax_20_tax_incl) + + self.assertEqual(self.invoice.amount_untaxed_signed, 100) + self.assertEqual(self.invoice.amount_total_signed, 120) + + def test_40_ftp_incl_2_incl_product_tax_excl(self): + invoice_form = Form(self.invoice) + invoice_form.fiscal_position_id = self.fiscal_position_20_incl_to_5_incl + with invoice_form.invoice_line_ids.new() as line: + line.product_id = self.product_20_tax_excl + invoice_form.save() + + # Mapping should not be executed + self.assertEqual(self.invoice.invoice_line_ids[0].price_unit, 100) + self.assertEqual(self.invoice.invoice_line_ids[0].tax_ids, self.tax_20_tax_excl) + + self.assertEqual(self.invoice.amount_untaxed_signed, 100) + self.assertEqual(self.invoice.amount_total_signed, 120) + + def test_41_ftp_incl_2_incl_product_tax_incl(self): + invoice_form = Form(self.invoice) + invoice_form.fiscal_position_id = self.fiscal_position_20_incl_to_5_incl + with invoice_form.invoice_line_ids.new() as line: + line.product_id = self.product_20_tax_incl + invoice_form.save() + + self.assertEqual(self.invoice.invoice_line_ids[0].price_unit, 105) + self.assertEqual(self.invoice.invoice_line_ids[0].tax_ids, self.tax_5_tax_incl) + + self.assertEqual(self.invoice.amount_untaxed_signed, 100) + self.assertEqual(self.invoice.amount_total_signed, 105) + + # ############################## + # Test Section "New Feature" (B) + # ############################## + + def test_20_FIX_ftp_excl_2_incl_product_tax_excl(self): + invoice_form = Form(self.invoice) + invoice_form.fiscal_position_id = self.fiscal_position_20_excl_to_20_incl + with invoice_form.invoice_line_ids.new() as line: + line.product_id = self.product_20_tax_excl + invoice_form.save() + + self.assertEqual(self.invoice.invoice_line_ids[0].price_unit, 120) + self.assertEqual(self.invoice.invoice_line_ids[0].tax_ids, self.tax_20_tax_incl) + + self.assertEqual(self.invoice.amount_untaxed_signed, 100) + self.assertEqual(self.invoice.amount_total_signed, 120) diff --git a/account_fiscal_position_type/tests/test_module.py b/account_fiscal_position_type/tests/test_module.py index de2a20f6a..fe43c1935 100644 --- a/account_fiscal_position_type/tests/test_module.py +++ b/account_fiscal_position_type/tests/test_module.py @@ -47,12 +47,20 @@ def test_chart_template_generation(self): def test_invoice_fiscal_position_domain(self): customer_invoice = self.env.ref("account.1_demo_invoice_3").copy() self.assertEqual( - customer_invoice.suitable_fiscal_position_ids.mapped("type_position_use"), - ["sale", "all"], + set( + customer_invoice.suitable_fiscal_position_ids.mapped( + "type_position_use" + ) + ), + {"sale", "all"}, ) supplier_invoice = self.env.ref("account.1_demo_invoice_5").copy() self.assertEqual( - supplier_invoice.suitable_fiscal_position_ids.mapped("type_position_use"), - ["purchase", "all"], + set( + supplier_invoice.suitable_fiscal_position_ids.mapped( + "type_position_use" + ) + ), + {"purchase", "all"}, ) diff --git a/setup/account_fiscal_position_tax_included/odoo/addons/account_fiscal_position_tax_included b/setup/account_fiscal_position_tax_included/odoo/addons/account_fiscal_position_tax_included new file mode 120000 index 000000000..28a06af95 --- /dev/null +++ b/setup/account_fiscal_position_tax_included/odoo/addons/account_fiscal_position_tax_included @@ -0,0 +1 @@ +../../../../account_fiscal_position_tax_included \ No newline at end of file diff --git a/setup/account_fiscal_position_tax_included/setup.py b/setup/account_fiscal_position_tax_included/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/account_fiscal_position_tax_included/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)