From 0c02d550b1f7bf541df1aa9e1e98c7d6d109fa11 Mon Sep 17 00:00:00 2001 From: bosd Date: Mon, 13 Nov 2023 11:45:19 +0100 Subject: [PATCH 1/3] l10n_nl_account_tax_unece: Update account_tax_codes Update the UNECE tax codes according to https://www.softwarepakketten.nl/wiki_uitleg/10&bronw=7/UBL_en_BTW_algemene_informatie.htm Update account_tax_template.xml Update account_tax_template.xml Update test_nl_account_tax_unece.py [IMP][FIX] l10n_nl_account_tax_unece: Update mapping --- l10n_nl_account_tax_unece/README.rst | 9 ++- .../data/account_tax_template.xml | 66 +++++++++---------- .../models/res_company.py | 66 +++++++++---------- .../readme/CONTRIBUTORS.rst | 1 + l10n_nl_account_tax_unece/readme/HISTORY.rst | 6 ++ .../static/description/index.html | 61 +++++++++-------- .../tests/test_nl_account_tax_unece.py | 8 ++- 7 files changed, 121 insertions(+), 96 deletions(-) diff --git a/l10n_nl_account_tax_unece/README.rst b/l10n_nl_account_tax_unece/README.rst index 129dabe8e..51c303aa1 100644 --- a/l10n_nl_account_tax_unece/README.rst +++ b/l10n_nl_account_tax_unece/README.rst @@ -7,7 +7,7 @@ L10n NL Account Tax UNECE !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:590489c7386f1a628d0ee8a5169437e1a458011bc75e5fa6ba34de115c28c128 + !! source digest: sha256:810e0998c58ce909a8ea140a0d083fa341224b3bbb8600f5d2b33b9c443a3c0e !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png @@ -52,6 +52,12 @@ Usage Changelog ========= +14.0.1.1.0 +~~~~~~~~~~ + +* Update unece tax tags according to NLCIUS + Source: forumstandaardisatie.nl/open-standaarden/nlcius + 13.0.1.0.0 ~~~~~~~~~~ @@ -99,6 +105,7 @@ Contributors ~~~~~~~~~~~~ * Andrea Stirpe +* bosd Other credits ~~~~~~~~~~~~~ diff --git a/l10n_nl_account_tax_unece/data/account_tax_template.xml b/l10n_nl_account_tax_unece/data/account_tax_template.xml index 7ce1da7c2..100e5b6e8 100644 --- a/l10n_nl_account_tax_unece/data/account_tax_template.xml +++ b/l10n_nl_account_tax_unece/data/account_tax_template.xml @@ -10,15 +10,15 @@ - + - + - + @@ -31,15 +31,15 @@ - + - + - + @@ -48,27 +48,27 @@ - + - + - + - + - + - + @@ -77,15 +77,15 @@ - + - + - + @@ -94,29 +94,29 @@ - + - + - + - + - + - + @@ -134,33 +134,33 @@ - + - + - + - + - + - + - + @@ -169,24 +169,24 @@ - + - + - + - + - + diff --git a/l10n_nl_account_tax_unece/models/res_company.py b/l10n_nl_account_tax_unece/models/res_company.py index f9bf9f943..bd55cbfdd 100644 --- a/l10n_nl_account_tax_unece/models/res_company.py +++ b/l10n_nl_account_tax_unece/models/res_company.py @@ -5,48 +5,48 @@ MAPPING = { "btw_0": {"categ": "tax_categ_z"}, - "btw_6": {"categ": "tax_categ_aa"}, - "btw_9": {"categ": "tax_categ_aa"}, - "btw_21": {"categ": "tax_categ_h"}, + "btw_6": {"categ": "tax_categ_s"}, + "btw_9": {"categ": "tax_categ_s"}, + "btw_21": {"categ": "tax_categ_s"}, "btw_overig": {"categ": "tax_categ_s"}, "btw_0_d": {"categ": "tax_categ_z"}, - "btw_6_d": {"categ": "tax_categ_aa"}, - "btw_9_d": {"categ": "tax_categ_aa"}, - "btw_21_d": {"categ": "tax_categ_h"}, + "btw_6_d": {"categ": "tax_categ_s"}, + "btw_9_d": {"categ": "tax_categ_s"}, + "btw_21_d": {"categ": "tax_categ_s"}, "btw_overig_d": {"categ": "tax_categ_s"}, - "btw_6_buy": {"categ": "tax_categ_aa"}, - "btw_6_buy_incl": {"categ": "tax_categ_aa"}, - "btw_9_buy": {"categ": "tax_categ_aa"}, - "btw_9_buy_incl": {"categ": "tax_categ_aa"}, - "btw_21_buy": {"categ": "tax_categ_h"}, - "btw_21_buy_incl": {"categ": "tax_categ_h"}, + "btw_6_buy": {"categ": "tax_categ_s"}, + "btw_6_buy_incl": {"categ": "tax_categ_s"}, + "btw_9_buy": {"categ": "tax_categ_s"}, + "btw_9_buy_incl": {"categ": "tax_categ_s"}, + "btw_21_buy": {"categ": "tax_categ_s"}, + "btw_21_buy_incl": {"categ": "tax_categ_s"}, "btw_overig_buy": {"categ": "tax_categ_s"}, - "btw_6_buy_d": {"categ": "tax_categ_aa"}, - "btw_9_buy_d": {"categ": "tax_categ_aa"}, - "btw_21_buy_d": {"categ": "tax_categ_h"}, + "btw_6_buy_d": {"categ": "tax_categ_s"}, + "btw_9_buy_d": {"categ": "tax_categ_s"}, + "btw_21_buy_d": {"categ": "tax_categ_s"}, "btw_overig_buy_d": {"categ": "tax_categ_s"}, - "btw_verk_0": {"categ": "tax_categ_b"}, - "btw_ink_0": {"categ": "tax_categ_b"}, - "btw_I_6": {"categ": "tax_categ_aa"}, - "btw_I_9": {"categ": "tax_categ_aa"}, - "btw_I_21": {"categ": "tax_categ_h"}, - "btw_I_overig": {"categ": "tax_categ_s"}, + "btw_verk_0": {"categ": "tax_categ_ae"}, + "btw_ink_0": {"categ": "tax_categ_ae"}, + "btw_I_6": {"categ": "tax_categ_s"}, + "btw_I_9": {"categ": "tax_categ_s"}, + "btw_I_21": {"categ": "tax_categ_s"}, + "btw_I_overig": {"categ": "tax_categ_k"}, "btw_X0_producten": {"categ": "tax_categ_e"}, "btw_X0_diensten": {"categ": "tax_categ_e"}, "btw_X2": {"categ": "tax_categ_e"}, - "btw_I_6_d": {"categ": "tax_categ_aa"}, - "btw_I_9_d": {"categ": "tax_categ_aa"}, - "btw_I_21_d": {"categ": "tax_categ_h"}, - "btw_I_overig_d": {"categ": "tax_categ_s"}, - "btw_E1": {"categ": "tax_categ_aa"}, - "btw_E1_9": {"categ": "tax_categ_aa"}, - "btw_E2": {"categ": "tax_categ_h"}, + "btw_I_6_d": {"categ": "tax_categ_s"}, + "btw_I_9_d": {"categ": "tax_categ_s"}, + "btw_I_21_d": {"categ": "tax_categ_s"}, + "btw_I_overig_d": {"categ": "tax_categ_k"}, + "btw_E1": {"categ": "tax_categ_s"}, + "btw_E1_9": {"categ": "tax_categ_s"}, + "btw_E2": {"categ": "tax_categ_s"}, "btw_E_overig": {"categ": "tax_categ_s"}, - "btw_X1": {"categ": "tax_categ_b"}, - "btw_X3": {"categ": "tax_categ_b"}, - "btw_E1_d": {"categ": "tax_categ_aa"}, - "btw_E1_d_9": {"categ": "tax_categ_aa"}, - "btw_E2_d": {"categ": "tax_categ_h"}, + "btw_X1": {"categ": "tax_categ_g"}, + "btw_X3": {"categ": "tax_categ_g"}, + "btw_E1_d": {"categ": "tax_categ_s"}, + "btw_E1_d_9": {"categ": "tax_categ_s"}, + "btw_E2_d": {"categ": "tax_categ_s"}, "btw_E_overig_d": {"categ": "tax_categ_s"}, } diff --git a/l10n_nl_account_tax_unece/readme/CONTRIBUTORS.rst b/l10n_nl_account_tax_unece/readme/CONTRIBUTORS.rst index 4518218c8..9650c4fd0 100644 --- a/l10n_nl_account_tax_unece/readme/CONTRIBUTORS.rst +++ b/l10n_nl_account_tax_unece/readme/CONTRIBUTORS.rst @@ -1 +1,2 @@ * Andrea Stirpe +* bosd diff --git a/l10n_nl_account_tax_unece/readme/HISTORY.rst b/l10n_nl_account_tax_unece/readme/HISTORY.rst index fad65740f..cfb4355b1 100644 --- a/l10n_nl_account_tax_unece/readme/HISTORY.rst +++ b/l10n_nl_account_tax_unece/readme/HISTORY.rst @@ -1,3 +1,9 @@ +14.0.1.1.0 +~~~~~~~~~~ + +* Update unece tax tags according to NLCIUS + Source: forumstandaardisatie.nl/open-standaarden/nlcius + 13.0.1.0.0 ~~~~~~~~~~ diff --git a/l10n_nl_account_tax_unece/static/description/index.html b/l10n_nl_account_tax_unece/static/description/index.html index b5e217334..61432718c 100644 --- a/l10n_nl_account_tax_unece/static/description/index.html +++ b/l10n_nl_account_tax_unece/static/description/index.html @@ -379,19 +379,20 @@

L10n NL Account Tax UNECE

  • Installation
  • Usage
  • Changelog
  • -
  • Bug Tracker
  • -
  • Credits @@ -410,38 +411,45 @@

    Usage

    Changelog

    -

    13.0.1.0.0

    +

    14.0.1.1.0

      -
    • Porting to V13
    • +
    • Update unece tax tags according to NLCIUS +Source: forumstandaardisatie.nl/open-standaarden/nlcius
    -

    12.0.1.0.0

    +

    13.0.1.0.0

      -
    • Porting to V12
    • +
    • Porting to V13
    -

    11.0.1.1.0

    +

    12.0.1.0.0

      -
    • Add support for tax codes 9%, introduced in Odoo 11.0 with commit)
    • +
    • Porting to V12
    -

    11.0.1.0.0

    +

    11.0.1.1.0

      -
    • Porting to V11
    • +
    • Add support for tax codes 9%, introduced in Odoo 11.0 with commit)
    -

    10.0.1.0.0

    +

    11.0.1.0.0

    +
      +
    • Porting to V11
    • +
    +
    +
    +

    10.0.1.0.0

    • Initial release.
    -

    Bug Tracker

    +

    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 @@ -449,21 +457,22 @@

    Bug Tracker

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

    -

    Credits

    +

    Credits

    -

    Authors

    +

    Authors

    • Onestein
    -

    Other credits

    +

    Other credits

    • This module, expecially the post_install script, is based on the job made by
      @@ -478,7 +487,7 @@

      Other credits

    -

    Maintainers

    +

    Maintainers

    This module is maintained by the OCA.

    Odoo Community Association

    OCA, or the Odoo Community Association, is a nonprofit organization whose diff --git a/l10n_nl_account_tax_unece/tests/test_nl_account_tax_unece.py b/l10n_nl_account_tax_unece/tests/test_nl_account_tax_unece.py index d6b6e0513..99eecbbb0 100644 --- a/l10n_nl_account_tax_unece/tests/test_nl_account_tax_unece.py +++ b/l10n_nl_account_tax_unece/tests/test_nl_account_tax_unece.py @@ -18,13 +18,15 @@ def setUp(self): self.env.user.company_id = old_company.id self.unece_type_id = self.env.ref("account_tax_unece.tax_type_vat").id + # Allowed NL categories according to NLCIUS + # Source: forumstandaardisatie.nl/open-standaarden/nlcius self.unece_categ_ids = [ - self.env.ref("account_tax_unece.tax_categ_h").id, - self.env.ref("account_tax_unece.tax_categ_aa").id, self.env.ref("account_tax_unece.tax_categ_z").id, self.env.ref("account_tax_unece.tax_categ_s").id, - self.env.ref("account_tax_unece.tax_categ_b").id, + self.env.ref("account_tax_unece.tax_categ_k").id, self.env.ref("account_tax_unece.tax_categ_e").id, + self.env.ref("account_tax_unece.tax_categ_g").id, + self.env.ref("account_tax_unece.tax_categ_ae").id, ] def test_load_coa(self): From 4b1c8ae0d55b8809c4c866e8170bc249259eeda4 Mon Sep 17 00:00:00 2001 From: bosd Date: Sat, 30 Dec 2023 17:03:51 +0100 Subject: [PATCH 2/3] l10n_nl_account_tax_unece: add migration script --- .../migrations/14.0.1.1.0/post-migration.py | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 l10n_nl_account_tax_unece/migrations/14.0.1.1.0/post-migration.py diff --git a/l10n_nl_account_tax_unece/migrations/14.0.1.1.0/post-migration.py b/l10n_nl_account_tax_unece/migrations/14.0.1.1.0/post-migration.py new file mode 100644 index 000000000..1b55a5c8b --- /dev/null +++ b/l10n_nl_account_tax_unece/migrations/14.0.1.1.0/post-migration.py @@ -0,0 +1,38 @@ +# 2021 Bosd +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +""" +The unece tags have been set with the no update tag. +Use openupgradelib to force load the changes. +""" + + +import logging + +from odoo import SUPERUSER_ID, api + +_logger = logging.getLogger(__name__) +try: + from openupgradelib import openupgrade +except ImportError: + openupgrade = None + + +def set_unece_on_taxes(cr): + with api.Environment.manage(): + env = api.Environment(cr, SUPERUSER_ID, {}) + for company in env["res.company"].search([]): + company._l10n_nl_set_unece_on_taxes() + + +def migrate(cr, version): + if openupgrade is None: + _logger.warning( + "OpenUpgradeLib is not found, can't update l10n_nl_account_tax_unece tags" + ) + return + _logger.warning("OpenUpgradeLib is going to upgrade nl l10n_nl_account_tax_unece") + openupgrade.load_data( + cr, "l10n_nl_account_tax_unece", "data/account_tax_template.xml", mode="init" + ) + set_unece_on_taxes(cr) From 207a83b9abcd06448ccccd2ccf3c46b92f6314b3 Mon Sep 17 00:00:00 2001 From: bosd Date: Sat, 30 Dec 2023 19:06:42 +0100 Subject: [PATCH 3/3] l10n_nl_account_tax_unece: forward port Update account_tax_codes --- l10n_nl_account_tax_unece/README.rst | 8 ++- l10n_nl_account_tax_unece/__manifest__.py | 2 +- .../post-migration.py | 0 l10n_nl_account_tax_unece/readme/HISTORY.rst | 6 ++ .../static/description/index.html | 66 +++++++++++-------- 5 files changed, 51 insertions(+), 31 deletions(-) rename l10n_nl_account_tax_unece/migrations/{14.0.1.1.0 => 15.0.1.1.0}/post-migration.py (100%) diff --git a/l10n_nl_account_tax_unece/README.rst b/l10n_nl_account_tax_unece/README.rst index 51c303aa1..285e065eb 100644 --- a/l10n_nl_account_tax_unece/README.rst +++ b/l10n_nl_account_tax_unece/README.rst @@ -7,7 +7,7 @@ L10n NL Account Tax UNECE !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:810e0998c58ce909a8ea140a0d083fa341224b3bbb8600f5d2b33b9c443a3c0e + !! source digest: sha256:11fc149a8ad2eeef58976fa668c44432b1a6b02f4d4ed29440dbb80268ffb793 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png @@ -52,6 +52,12 @@ Usage Changelog ========= +15.0.1.1.0 +~~~~~~~~~~ + +* Update unece tax tags according to NLCIUS + Source: forumstandaardisatie.nl/open-standaarden/nlcius + 14.0.1.1.0 ~~~~~~~~~~ diff --git a/l10n_nl_account_tax_unece/__manifest__.py b/l10n_nl_account_tax_unece/__manifest__.py index 8207c31f8..ccec2fc1a 100644 --- a/l10n_nl_account_tax_unece/__manifest__.py +++ b/l10n_nl_account_tax_unece/__manifest__.py @@ -4,7 +4,7 @@ { "name": "L10n NL Account Tax UNECE", "summary": "Auto-configure UNECE params on Dutch taxes", - "version": "15.0.1.0.0", + "version": "15.0.1.1.0", "category": "Localization", "author": "Onestein, Odoo Community Association (OCA)", "website": "https://github.com/OCA/l10n-netherlands", diff --git a/l10n_nl_account_tax_unece/migrations/14.0.1.1.0/post-migration.py b/l10n_nl_account_tax_unece/migrations/15.0.1.1.0/post-migration.py similarity index 100% rename from l10n_nl_account_tax_unece/migrations/14.0.1.1.0/post-migration.py rename to l10n_nl_account_tax_unece/migrations/15.0.1.1.0/post-migration.py diff --git a/l10n_nl_account_tax_unece/readme/HISTORY.rst b/l10n_nl_account_tax_unece/readme/HISTORY.rst index cfb4355b1..38ac9191e 100644 --- a/l10n_nl_account_tax_unece/readme/HISTORY.rst +++ b/l10n_nl_account_tax_unece/readme/HISTORY.rst @@ -1,3 +1,9 @@ +15.0.1.1.0 +~~~~~~~~~~ + +* Update unece tax tags according to NLCIUS + Source: forumstandaardisatie.nl/open-standaarden/nlcius + 14.0.1.1.0 ~~~~~~~~~~ diff --git a/l10n_nl_account_tax_unece/static/description/index.html b/l10n_nl_account_tax_unece/static/description/index.html index 61432718c..921d44961 100644 --- a/l10n_nl_account_tax_unece/static/description/index.html +++ b/l10n_nl_account_tax_unece/static/description/index.html @@ -367,7 +367,7 @@

    L10n NL Account Tax UNECE

    !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:590489c7386f1a628d0ee8a5169437e1a458011bc75e5fa6ba34de115c28c128 +!! source digest: sha256:11fc149a8ad2eeef58976fa668c44432b1a6b02f4d4ed29440dbb80268ffb793 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

    Beta License: AGPL-3 OCA/l10n-netherlands Translate me on Weblate Try me on Runboat

    This module will auto-configure the values UNECE Tax Type and UNECE Tax Category on taxes that come from the l10n_nl module.

    @@ -379,20 +379,21 @@

    L10n NL Account Tax UNECE

  • Installation
  • Usage
  • Changelog
  • -
  • Bug Tracker
  • -
  • Credits @@ -411,45 +412,52 @@

    Usage

    Changelog

    -

    14.0.1.1.0

    +

    15.0.1.1.0

    • Update unece tax tags according to NLCIUS Source: forumstandaardisatie.nl/open-standaarden/nlcius
    -

    13.0.1.0.0

    +

    14.0.1.1.0

      -
    • Porting to V13
    • +
    • Update unece tax tags according to NLCIUS +Source: forumstandaardisatie.nl/open-standaarden/nlcius
    -

    12.0.1.0.0

    +

    13.0.1.0.0

      -
    • Porting to V12
    • +
    • Porting to V13
    -

    11.0.1.1.0

    +

    12.0.1.0.0

      -
    • Add support for tax codes 9%, introduced in Odoo 11.0 with commit)
    • +
    • Porting to V12
    -

    11.0.1.0.0

    +

    11.0.1.1.0

      -
    • Porting to V11
    • +
    • Add support for tax codes 9%, introduced in Odoo 11.0 with commit)
    -

    10.0.1.0.0

    +

    11.0.1.0.0

    +
      +
    • Porting to V11
    • +
    +
    +
    +

    10.0.1.0.0

    • Initial release.
    -

    Bug Tracker

    +

    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 @@ -457,22 +465,22 @@

    Bug Tracker

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

    -

    Credits

    +

    Credits

    -

    Authors

    +

    Authors

    • Onestein
    -

    Other credits

    +

    Other credits

    • This module, expecially the post_install script, is based on the job made by
      @@ -487,7 +495,7 @@

      Other credits

    -

    Maintainers

    +

    Maintainers

    This module is maintained by the OCA.

    Odoo Community Association

    OCA, or the Odoo Community Association, is a nonprofit organization whose