From 6a2b8f618810f21371aad8d4a3b40512e216d209 Mon Sep 17 00:00:00 2001 From: Lukas Tran Date: Mon, 11 Nov 2024 14:12:55 +0700 Subject: [PATCH] [IMP] account_reconcile_restrict_partner_mismatch: pre-commit auto fixes --- .../README.rst | 64 +++++++++++-------- .../__manifest__.py | 2 +- .../models/account_journal.py | 1 - .../models/res_company.py | 1 - .../models/res_config_settings.py | 1 - .../pyproject.toml | 3 + .../readme/CONFIGURE.md | 8 +++ .../readme/CONFIGURE.rst | 5 -- .../readme/CONTRIBUTORS.md | 7 ++ .../readme/CONTRIBUTORS.rst | 6 -- .../readme/{CREDITS.rst => CREDITS.md} | 3 +- .../readme/DESCRIPTION.md | 14 ++++ .../readme/DESCRIPTION.rst | 12 ---- .../report/report_reconciled_lines.py | 5 +- .../static/description/index.html | 49 ++++++++------ .../tests/test_reconciliation.py | 6 +- 16 files changed, 110 insertions(+), 77 deletions(-) create mode 100644 account_reconcile_restrict_partner_mismatch/pyproject.toml create mode 100644 account_reconcile_restrict_partner_mismatch/readme/CONFIGURE.md delete mode 100644 account_reconcile_restrict_partner_mismatch/readme/CONFIGURE.rst create mode 100644 account_reconcile_restrict_partner_mismatch/readme/CONTRIBUTORS.md delete mode 100644 account_reconcile_restrict_partner_mismatch/readme/CONTRIBUTORS.rst rename account_reconcile_restrict_partner_mismatch/readme/{CREDITS.rst => CREDITS.md} (73%) create mode 100644 account_reconcile_restrict_partner_mismatch/readme/DESCRIPTION.md delete mode 100644 account_reconcile_restrict_partner_mismatch/readme/DESCRIPTION.rst diff --git a/account_reconcile_restrict_partner_mismatch/README.rst b/account_reconcile_restrict_partner_mismatch/README.rst index 00c5b00d00..8d2f43c866 100644 --- a/account_reconcile_restrict_partner_mismatch/README.rst +++ b/account_reconcile_restrict_partner_mismatch/README.rst @@ -17,29 +17,31 @@ Reconcile restrict partner mismatch :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--reconcile-lightgray.png?logo=github - :target: https://github.com/OCA/account-reconcile/tree/16.0/account_reconcile_restrict_partner_mismatch + :target: https://github.com/OCA/account-reconcile/tree/18.0/account_reconcile_restrict_partner_mismatch :alt: OCA/account-reconcile .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/account-reconcile-16-0/account-reconcile-16-0-account_reconcile_restrict_partner_mismatch + :target: https://translation.odoo-community.org/projects/account-reconcile-18-0/account-reconcile-18-0-account_reconcile_restrict_partner_mismatch :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-reconcile&target_branch=16.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/account-reconcile&target_branch=18.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| This module restricts reconciliation between journal items when: - - both items have different partners - - one item is with partner and the other without it + - both items have different partners + - one item is with partner and the other without it -This rule applies only for journal items using receivable and payable account type. +This rule applies only for journal items using receivable and payable +account type. -As at the moment of installation some journal items could have been reconciled -using different partners, you can detect them in menu Accounting > Adviser > -Reconciled items with partner mismatch. +As at the moment of installation some journal items could have been +reconciled using different partners, you can detect them in menu +Accounting > Adviser > Reconciled items with partner mismatch. -This restriction can be enabled per company but can also be deactivated per journal. +This restriction can be enabled per company but can also be deactivated +per journal. **Table of contents** @@ -49,11 +51,14 @@ This restriction can be enabled per company but can also be deactivated per jour Configuration ============= -- Go to Accounting > Configuration > Settings > Partners Mismatch Restriction on Reconcile +- Go to Accounting > Configuration > Settings > Partners Mismatch + Restriction on Reconcile - Check the box to activate the parameter. -- To deactivate the behavior on journal level, go to Accounting > Configuration > Accounting > Journals +- To deactivate the behavior on journal level, go to Accounting > + Configuration > Accounting > Journals - In Advanced Settings > Partner Mismatch On Reconcile -- Check the box if you want to deactivate the restriction for that journal entries. +- Check the box if you want to deactivate the restriction for that + journal entries. Bug Tracker =========== @@ -61,7 +66,7 @@ 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 `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -69,27 +74,34 @@ Credits ======= Authors -~~~~~~~ +------- * Camptocamp Contributors -~~~~~~~~~~~~ +------------ -* `Tecnativa `_: - * Ernesto Tejeda -* `Trobz `_: - * Nguyen Ho -* `ACSONE SA `_: - * Souheil Bejaoui +- `Tecnativa `__: + + - Ernesto Tejeda + +- `Trobz `__: + + - Nguyen Ho + - Nhan Tran + +- `ACSONE SA `__: + + - Souheil Bejaoui Other credits -~~~~~~~~~~~~~ +------------- -The migration of this module from 13.0 to 14.0 was financially supported by Camptocamp +The migration of this module from 13.0 to 14.0 was financially supported +by Camptocamp Maintainers -~~~~~~~~~~~ +----------- This module is maintained by the OCA. @@ -101,6 +113,6 @@ 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. -This module is part of the `OCA/account-reconcile `_ project on GitHub. +This module is part of the `OCA/account-reconcile `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/account_reconcile_restrict_partner_mismatch/__manifest__.py b/account_reconcile_restrict_partner_mismatch/__manifest__.py index 46a64f0d1e..70de0c0148 100644 --- a/account_reconcile_restrict_partner_mismatch/__manifest__.py +++ b/account_reconcile_restrict_partner_mismatch/__manifest__.py @@ -5,7 +5,7 @@ "name": "Reconcile restrict partner mismatch", "summary": "Restrict reconciliation on receivable " "and payable accounts to the same partner", - "version": "16.0.1.0.0", + "version": "18.0.1.0.0", "depends": ["account"], "author": "Camptocamp, Odoo Community Association (OCA)", "website": "https://github.com/OCA/account-reconcile", diff --git a/account_reconcile_restrict_partner_mismatch/models/account_journal.py b/account_reconcile_restrict_partner_mismatch/models/account_journal.py index b99c05d758..3e953a7c08 100644 --- a/account_reconcile_restrict_partner_mismatch/models/account_journal.py +++ b/account_reconcile_restrict_partner_mismatch/models/account_journal.py @@ -4,7 +4,6 @@ class AccountJournal(models.Model): - _inherit = "account.journal" no_restrict_partner_mismatch_on_reconcile = fields.Boolean( diff --git a/account_reconcile_restrict_partner_mismatch/models/res_company.py b/account_reconcile_restrict_partner_mismatch/models/res_company.py index 03a8943769..c9e86ef2c4 100644 --- a/account_reconcile_restrict_partner_mismatch/models/res_company.py +++ b/account_reconcile_restrict_partner_mismatch/models/res_company.py @@ -4,7 +4,6 @@ class ResCompany(models.Model): - _inherit = "res.company" restrict_partner_mismatch_on_reconcile = fields.Boolean( diff --git a/account_reconcile_restrict_partner_mismatch/models/res_config_settings.py b/account_reconcile_restrict_partner_mismatch/models/res_config_settings.py index 2dba2cbccf..ae748d039b 100644 --- a/account_reconcile_restrict_partner_mismatch/models/res_config_settings.py +++ b/account_reconcile_restrict_partner_mismatch/models/res_config_settings.py @@ -4,7 +4,6 @@ class ResConfigSettings(models.TransientModel): - _inherit = "res.config.settings" restrict_partner_mismatch_on_reconcile = fields.Boolean( diff --git a/account_reconcile_restrict_partner_mismatch/pyproject.toml b/account_reconcile_restrict_partner_mismatch/pyproject.toml new file mode 100644 index 0000000000..4231d0cccb --- /dev/null +++ b/account_reconcile_restrict_partner_mismatch/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/account_reconcile_restrict_partner_mismatch/readme/CONFIGURE.md b/account_reconcile_restrict_partner_mismatch/readme/CONFIGURE.md new file mode 100644 index 0000000000..65425f1304 --- /dev/null +++ b/account_reconcile_restrict_partner_mismatch/readme/CONFIGURE.md @@ -0,0 +1,8 @@ +- Go to Accounting \> Configuration \> Settings \> Partners Mismatch + Restriction on Reconcile +- Check the box to activate the parameter. +- To deactivate the behavior on journal level, go to Accounting \> + Configuration \> Accounting \> Journals +- In Advanced Settings \> Partner Mismatch On Reconcile +- Check the box if you want to deactivate the restriction for that + journal entries. diff --git a/account_reconcile_restrict_partner_mismatch/readme/CONFIGURE.rst b/account_reconcile_restrict_partner_mismatch/readme/CONFIGURE.rst deleted file mode 100644 index e7bbae30f2..0000000000 --- a/account_reconcile_restrict_partner_mismatch/readme/CONFIGURE.rst +++ /dev/null @@ -1,5 +0,0 @@ -- Go to Accounting > Configuration > Settings > Partners Mismatch Restriction on Reconcile -- Check the box to activate the parameter. -- To deactivate the behavior on journal level, go to Accounting > Configuration > Accounting > Journals -- In Advanced Settings > Partner Mismatch On Reconcile -- Check the box if you want to deactivate the restriction for that journal entries. diff --git a/account_reconcile_restrict_partner_mismatch/readme/CONTRIBUTORS.md b/account_reconcile_restrict_partner_mismatch/readme/CONTRIBUTORS.md new file mode 100644 index 0000000000..1ecf6807e8 --- /dev/null +++ b/account_reconcile_restrict_partner_mismatch/readme/CONTRIBUTORS.md @@ -0,0 +1,7 @@ +- [Tecnativa](https://www.tecnativa.com): + - Ernesto Tejeda +- [Trobz](https://trobz.com): + - Nguyen Ho \<\> + - Nhan Tran \<\> +- [ACSONE SA](https://acsone.eu): + - Souheil Bejaoui \<\> diff --git a/account_reconcile_restrict_partner_mismatch/readme/CONTRIBUTORS.rst b/account_reconcile_restrict_partner_mismatch/readme/CONTRIBUTORS.rst deleted file mode 100644 index c2b261b8ac..0000000000 --- a/account_reconcile_restrict_partner_mismatch/readme/CONTRIBUTORS.rst +++ /dev/null @@ -1,6 +0,0 @@ -* `Tecnativa `_: - * Ernesto Tejeda -* `Trobz `_: - * Nguyen Ho -* `ACSONE SA `_: - * Souheil Bejaoui diff --git a/account_reconcile_restrict_partner_mismatch/readme/CREDITS.rst b/account_reconcile_restrict_partner_mismatch/readme/CREDITS.md similarity index 73% rename from account_reconcile_restrict_partner_mismatch/readme/CREDITS.rst rename to account_reconcile_restrict_partner_mismatch/readme/CREDITS.md index f37ebe7570..4351fe296a 100644 --- a/account_reconcile_restrict_partner_mismatch/readme/CREDITS.rst +++ b/account_reconcile_restrict_partner_mismatch/readme/CREDITS.md @@ -1 +1,2 @@ -The migration of this module from 13.0 to 14.0 was financially supported by Camptocamp +The migration of this module from 13.0 to 14.0 was financially supported +by Camptocamp diff --git a/account_reconcile_restrict_partner_mismatch/readme/DESCRIPTION.md b/account_reconcile_restrict_partner_mismatch/readme/DESCRIPTION.md new file mode 100644 index 0000000000..a974842681 --- /dev/null +++ b/account_reconcile_restrict_partner_mismatch/readme/DESCRIPTION.md @@ -0,0 +1,14 @@ +This module restricts reconciliation between journal items when: + +> - both items have different partners +> - one item is with partner and the other without it + +This rule applies only for journal items using receivable and payable +account type. + +As at the moment of installation some journal items could have been +reconciled using different partners, you can detect them in menu +Accounting \> Adviser \> Reconciled items with partner mismatch. + +This restriction can be enabled per company but can also be deactivated +per journal. diff --git a/account_reconcile_restrict_partner_mismatch/readme/DESCRIPTION.rst b/account_reconcile_restrict_partner_mismatch/readme/DESCRIPTION.rst deleted file mode 100644 index a5d44a4e1e..0000000000 --- a/account_reconcile_restrict_partner_mismatch/readme/DESCRIPTION.rst +++ /dev/null @@ -1,12 +0,0 @@ -This module restricts reconciliation between journal items when: - - - both items have different partners - - one item is with partner and the other without it - -This rule applies only for journal items using receivable and payable account type. - -As at the moment of installation some journal items could have been reconciled -using different partners, you can detect them in menu Accounting > Adviser > -Reconciled items with partner mismatch. - -This restriction can be enabled per company but can also be deactivated per journal. diff --git a/account_reconcile_restrict_partner_mismatch/report/report_reconciled_lines.py b/account_reconcile_restrict_partner_mismatch/report/report_reconciled_lines.py index e98ca0eac0..57ab0f8124 100644 --- a/account_reconcile_restrict_partner_mismatch/report/report_reconciled_lines.py +++ b/account_reconcile_restrict_partner_mismatch/report/report_reconciled_lines.py @@ -29,7 +29,7 @@ def init(self): """Select lines which violate defined rules""" tools.drop_view_if_exists(self.env.cr, self._table) self._cr.execute( - """CREATE OR REPLACE VIEW %s AS ( + f"""CREATE OR REPLACE VIEW {self._table} AS ( SELECT pr.id id , pr.id partial_reconcile_id , pr.full_reconcile_id @@ -55,6 +55,5 @@ def init(self): OR (caml.partner_id IS NULL AND daml.partner_id IS NOT NULL)) ) - """ - % self._table + """ ) diff --git a/account_reconcile_restrict_partner_mismatch/static/description/index.html b/account_reconcile_restrict_partner_mismatch/static/description/index.html index 29317314b0..2c52609d96 100644 --- a/account_reconcile_restrict_partner_mismatch/static/description/index.html +++ b/account_reconcile_restrict_partner_mismatch/static/description/index.html @@ -369,7 +369,7 @@

Reconcile restrict partner mismatch

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:893e295e519a93dd096174319fa89d25509ab7df53a313bf5cc93c2b98a6be42 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

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

+

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

This module restricts reconciliation between journal items when:

    @@ -377,11 +377,13 @@

    Reconcile restrict partner mismatch

  • one item is with partner and the other without it
-

This rule applies only for journal items using receivable and payable account type.

-

As at the moment of installation some journal items could have been reconciled -using different partners, you can detect them in menu Accounting > Adviser > -Reconciled items with partner mismatch.

-

This restriction can be enabled per company but can also be deactivated per journal.

+

This rule applies only for journal items using receivable and payable +account type.

+

As at the moment of installation some journal items could have been +reconciled using different partners, you can detect them in menu +Accounting > Adviser > Reconciled items with partner mismatch.

+

This restriction can be enabled per company but can also be deactivated +per journal.

Table of contents

    @@ -399,11 +401,14 @@

    Reconcile restrict partner mismatch

    Configuration

      -
    • Go to Accounting > Configuration > Settings > Partners Mismatch Restriction on Reconcile
    • +
    • Go to Accounting > Configuration > Settings > Partners Mismatch +Restriction on Reconcile
    • Check the box to activate the parameter.
    • -
    • To deactivate the behavior on journal level, go to Accounting > Configuration > Accounting > Journals
    • +
    • To deactivate the behavior on journal level, go to Accounting > +Configuration > Accounting > Journals
    • In Advanced Settings > Partner Mismatch On Reconcile
    • -
    • Check the box if you want to deactivate the restriction for that journal entries.
    • +
    • Check the box if you want to deactivate the restriction for that +journal entries.
    @@ -411,7 +416,7 @@

    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.

    +feedback.

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

    @@ -425,17 +430,25 @@

    Authors

    Contributors

    Other credits

    -

    The migration of this module from 13.0 to 14.0 was financially supported by Camptocamp

    +

    The migration of this module from 13.0 to 14.0 was financially supported +by Camptocamp

    Maintainers

    @@ -446,7 +459,7 @@

    Maintainers

    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.

    -

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

    +

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

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

    diff --git a/account_reconcile_restrict_partner_mismatch/tests/test_reconciliation.py b/account_reconcile_restrict_partner_mismatch/tests/test_reconciliation.py index 5764d5bc4c..1be0bd1d8d 100644 --- a/account_reconcile_restrict_partner_mismatch/tests/test_reconciliation.py +++ b/account_reconcile_restrict_partner_mismatch/tests/test_reconciliation.py @@ -86,7 +86,8 @@ def test_reconcile_partner_mismatch(self): with self.assertRaises(UserError) as exc: self.aml.reconcile() self.assertIn( - "The partner has to be the same on all lines for receivable and payable accounts!", + "The partner has to be the same on all lines " + "for receivable and payable accounts!", exc.exception.args[0], ) # all lines with same partner allowed @@ -121,7 +122,8 @@ def test_reconcile_accounts_excluded(self): with self.assertRaises(UserError) as exc: self.aml.reconcile() self.assertIn( - "The partner has to be the same on all lines for receivable and payable accounts!", + "The partner has to be the same on all lines " + "for receivable and payable accounts!", exc.exception.args[0], ) # reconciliation forbiden only for certain types of accounts