From 171a989930710ea5a812a8ca5f17d1f5c668485c Mon Sep 17 00:00:00 2001 From: Lois Rilo Date: Mon, 24 Oct 2022 13:28:50 +0200 Subject: [PATCH 1/2] [IMP] account_chart_update: improve extensibility --- account_chart_update/wizard/wizard_chart_update.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/account_chart_update/wizard/wizard_chart_update.py b/account_chart_update/wizard/wizard_chart_update.py index 915b5bfbb..834a15016 100644 --- a/account_chart_update/wizard/wizard_chart_update.py +++ b/account_chart_update/wizard/wizard_chart_update.py @@ -778,6 +778,13 @@ class WizardUpdateChartsAccounts(models.TransientModel): ] ) + def _domain_taxes_to_deactivate(self, found_taxes_ids): + return [ + ("company_id", "=", self.company_id.id), + ("id", "not in", found_taxes_ids), + ("active", "=", True), + ] + def _find_taxes(self): """Search for, and load, tax templates to create/update/delete.""" found_taxes_ids = [] @@ -821,11 +828,7 @@ class WizardUpdateChartsAccounts(models.TransientModel): # search for taxes not in the template and propose them for # deactivation taxes_to_deactivate = self.env["account.tax"].search( - [ - ("company_id", "=", self.company_id.id), - ("id", "not in", found_taxes_ids), - ("active", "=", True), - ] + self._domain_taxes_to_deactivate(found_taxes_ids) ) for tax in taxes_to_deactivate: self.tax_ids.create( From 167d9597989ad318239333cf26e3fab5b7ffe365 Mon Sep 17 00:00:00 2001 From: Lois Rilo Date: Mon, 24 Oct 2022 13:41:48 +0200 Subject: [PATCH 2/2] [ADD] account_chart_update_l10n_eu_oss --- account_chart_update_l10n_eu_oss/README.rst | 82 ++++ account_chart_update_l10n_eu_oss/__init__.py | 1 + .../__manifest__.py | 18 + .../readme/CONTRIBUTORS.rst | 1 + .../readme/DESCRIPTION.rst | 2 + .../static/description/index.html | 422 ++++++++++++++++++ .../wizard/__init__.py | 1 + .../wizard/wizard_chart_update.py | 13 + .../addons/account_chart_update_l10n_eu_oss | 1 + .../account_chart_update_l10n_eu_oss/setup.py | 6 + 10 files changed, 547 insertions(+) create mode 100644 account_chart_update_l10n_eu_oss/README.rst create mode 100644 account_chart_update_l10n_eu_oss/__init__.py create mode 100644 account_chart_update_l10n_eu_oss/__manifest__.py create mode 100644 account_chart_update_l10n_eu_oss/readme/CONTRIBUTORS.rst create mode 100644 account_chart_update_l10n_eu_oss/readme/DESCRIPTION.rst create mode 100644 account_chart_update_l10n_eu_oss/static/description/index.html create mode 100644 account_chart_update_l10n_eu_oss/wizard/__init__.py create mode 100644 account_chart_update_l10n_eu_oss/wizard/wizard_chart_update.py create mode 120000 setup/account_chart_update_l10n_eu_oss/odoo/addons/account_chart_update_l10n_eu_oss create mode 100644 setup/account_chart_update_l10n_eu_oss/setup.py diff --git a/account_chart_update_l10n_eu_oss/README.rst b/account_chart_update_l10n_eu_oss/README.rst new file mode 100644 index 000000000..fb85cb829 --- /dev/null +++ b/account_chart_update_l10n_eu_oss/README.rst @@ -0,0 +1,82 @@ +========================= +Account Chart update OSS +========================= + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! 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/15.0/account_chart_update_l10n_eu_oss + :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-15-0/account-financial-tools-15-0-account_chart_update_l10n_eu_oss + :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/15.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +Glue module for account chart update and OSS. It makes the wizard ignore OSS +taxes when updating the CoA. + +**Table of contents** + +.. contents:: + :local: + +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 +~~~~~~~ + +* ForgeFlow + +Contributors +~~~~~~~~~~~~ + +* Lois Rilo + +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-LoisRForgeFlow| image:: https://github.com/LoisRForgeFlow.png?size=40px + :target: https://github.com/LoisRForgeFlow + :alt: LoisRForgeFlow + +Current `maintainer `__: + +|maintainer-LoisRForgeFlow| + +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_chart_update_l10n_eu_oss/__init__.py b/account_chart_update_l10n_eu_oss/__init__.py new file mode 100644 index 000000000..40272379f --- /dev/null +++ b/account_chart_update_l10n_eu_oss/__init__.py @@ -0,0 +1 @@ +from . import wizard diff --git a/account_chart_update_l10n_eu_oss/__manifest__.py b/account_chart_update_l10n_eu_oss/__manifest__.py new file mode 100644 index 000000000..ffc6a49e2 --- /dev/null +++ b/account_chart_update_l10n_eu_oss/__manifest__.py @@ -0,0 +1,18 @@ +# Copyright 2022 ForgeFlow S.L. (https://www.forgeflow.com) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Account Chart update OSS ", + "version": "15.0.1.0.0", + "author": "ForgeFlow, Odoo Community Association (OCA)", + "maintainers": ["LoisRForgeFlow"], + "website": "https://github.com/OCA/account-financial-tools", + "category": "Accounting", + "license": "AGPL-3", + "depends": [ + "account_chart_update", + "l10n_eu_oss", + ], + "installable": True, + "auto_install": True, +} diff --git a/account_chart_update_l10n_eu_oss/readme/CONTRIBUTORS.rst b/account_chart_update_l10n_eu_oss/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..77dfbe89e --- /dev/null +++ b/account_chart_update_l10n_eu_oss/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* Lois Rilo diff --git a/account_chart_update_l10n_eu_oss/readme/DESCRIPTION.rst b/account_chart_update_l10n_eu_oss/readme/DESCRIPTION.rst new file mode 100644 index 000000000..cb81392e7 --- /dev/null +++ b/account_chart_update_l10n_eu_oss/readme/DESCRIPTION.rst @@ -0,0 +1,2 @@ +Glue module for account chart update and OSS. It makes the wizard ignore OSS +taxes when updating the CoA. diff --git a/account_chart_update_l10n_eu_oss/static/description/index.html b/account_chart_update_l10n_eu_oss/static/description/index.html new file mode 100644 index 000000000..4f21573e4 --- /dev/null +++ b/account_chart_update_l10n_eu_oss/static/description/index.html @@ -0,0 +1,422 @@ + + + + + + +Account Chart update OSS + + + +
+

Account Chart update OSS

+ + +

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

+

Glue module for account chart update and OSS. It makes the wizard ignore OSS +taxes when updating the CoA.

+

Table of contents

+ +
+

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

+
    +
  • ForgeFlow
  • +
+
+ +
+

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:

+

LoisRForgeFlow

+

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_chart_update_l10n_eu_oss/wizard/__init__.py b/account_chart_update_l10n_eu_oss/wizard/__init__.py new file mode 100644 index 000000000..fbd95d57b --- /dev/null +++ b/account_chart_update_l10n_eu_oss/wizard/__init__.py @@ -0,0 +1 @@ +from . import wizard_chart_update diff --git a/account_chart_update_l10n_eu_oss/wizard/wizard_chart_update.py b/account_chart_update_l10n_eu_oss/wizard/wizard_chart_update.py new file mode 100644 index 000000000..81274860b --- /dev/null +++ b/account_chart_update_l10n_eu_oss/wizard/wizard_chart_update.py @@ -0,0 +1,13 @@ +# Copyright 2022 ForgeFlow S.L. (https://www.forgeflow.com) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import models + + +class WizardUpdateChartsAccounts(models.TransientModel): + _inherit = "wizard.update.charts.accounts" + + def _domain_taxes_to_deactivate(self, found_taxes_ids): + domain = super()._domain_taxes_to_deactivate(found_taxes_ids) + domain.append(("tax_group_id.name", "not like", "OSS%%")) + return domain diff --git a/setup/account_chart_update_l10n_eu_oss/odoo/addons/account_chart_update_l10n_eu_oss b/setup/account_chart_update_l10n_eu_oss/odoo/addons/account_chart_update_l10n_eu_oss new file mode 120000 index 000000000..09efc025e --- /dev/null +++ b/setup/account_chart_update_l10n_eu_oss/odoo/addons/account_chart_update_l10n_eu_oss @@ -0,0 +1 @@ +../../../../account_chart_update_l10n_eu_oss \ No newline at end of file diff --git a/setup/account_chart_update_l10n_eu_oss/setup.py b/setup/account_chart_update_l10n_eu_oss/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/account_chart_update_l10n_eu_oss/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)