diff --git a/account_chart_update/README.rst b/account_chart_update/README.rst index 265ba6bd955..62f294002f7 100644 --- a/account_chart_update/README.rst +++ b/account_chart_update/README.rst @@ -17,29 +17,29 @@ Detect changes and update the Account Chart from a template :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/16.0/account_chart_update + :target: https://github.com/OCA/account-financial-tools/tree/17.0/account_chart_update :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-16-0/account-financial-tools-16-0-account_chart_update + :target: https://translation.odoo-community.org/projects/account-financial-tools-17-0/account-financial-tools-17-0-account_chart_update :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-financial-tools&target_branch=16.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/account-financial-tools&target_branch=17.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| -This is a pretty useful tool to update Odoo installations after tax reforms -on the official charts of accounts, or to apply fixes performed on the chart -template. +This is a pretty useful tool to update Odoo installations after tax +reforms on the official charts of accounts, or to apply fixes performed +on the chart template. The wizard: -* Allows the user to compare a chart and a template showing differences - on accounts, taxes, tax codes and fiscal positions. -* It may create the new account, taxes, tax codes and fiscal positions detected - on the template. -* It can also update (overwrite) the accounts, taxes, tax codes and fiscal - positions that got modified on the template. +- Allows the user to compare a chart and a template showing differences + on accounts, taxes, tax codes and fiscal positions. +- It may create the new account, taxes, tax codes and fiscal positions + detected on the template. +- It can also update (overwrite) the accounts, taxes, tax codes and + fiscal positions that got modified on the template. **Table of contents** @@ -49,22 +49,23 @@ The wizard: Usage ===== -The wizard, accesible from *Accounting > Settings > Update Chart Template*, -lets the user select what kind of objects must be checked/updated, and whether -old records must be checked for changes and updates. +The wizard, accesible from *Accounting > Settings > Update Chart +Template*, lets the user select what kind of objects must be +checked/updated, and whether old records must be checked for changes and +updates. -It will display all the objects to be created / updated / deactivated with some -information about the detected differences, and allow the user to exclude -records individually. +It will display all the objects to be created / updated / deactivated +with some information about the detected differences, and allow the user +to exclude records individually. Known issues / Roadmap ====================== -* Generate and update account reconcile models. -* Generate XML-ID for fiscal position tax and account mapping lines. -* Allow to select independently operations to perform (create, update, - deactivate). -* Detect fiscal positions to deactivate? +- Generate and update account reconcile models. +- Generate XML-ID for fiscal position tax and account mapping lines. +- Allow to select independently operations to perform (create, update, + deactivate). +- Detect fiscal positions to deactivate? Bug Tracker =========== @@ -72,7 +73,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. @@ -80,32 +81,32 @@ Credits ======= Authors -~~~~~~~ +------- * Tecnativa * BCIM * Okia Contributors -~~~~~~~~~~~~ +------------ -* `Tecnativa `_: +- `Tecnativa `__: - * Pedro M. Baeza - * Ernesto Tejeda + - Pedro M. Baeza + - Ernesto Tejeda -* Jacques-Etienne Baudoux -* Sylvain Van Hoof -* Nacho Muñoz -* Alberto Martín - Guadaltech -* Fernando La Chica - GreenIce -* Jairo Llopis (https://www.moduon.team/) -* `Factor Libre `_: +- Jacques-Etienne Baudoux +- Sylvain Van Hoof +- Nacho Muñoz +- Alberto Martín - Guadaltech +- Fernando La Chica - GreenIce +- Jairo Llopis (https://www.moduon.team/) +- `Factor Libre `__: - * Luis J. Salvatierra + - Luis J. Salvatierra Maintainers -~~~~~~~~~~~ +----------- This module is maintained by the OCA. @@ -117,6 +118,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-financial-tools `_ project on GitHub. +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/models/ir_model_fields.py b/account_chart_update/models/ir_model_fields.py index db6817e1876..f7164322402 100644 --- a/account_chart_update/models/ir_model_fields.py +++ b/account_chart_update/models/ir_model_fields.py @@ -12,8 +12,6 @@ def name_get(self): if self.env.context.get("account_chart_update"): res = [] for record in self: - res.append( - (record.id, "{} ({})".format(record.field_description, record.name)) - ) + res.append((record.id, f"{record.field_description} ({record.name})")) return res return super(IrModelFields, self).name_get() diff --git a/account_chart_update/pyproject.toml b/account_chart_update/pyproject.toml new file mode 100644 index 00000000000..4231d0cccb3 --- /dev/null +++ b/account_chart_update/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/account_chart_update/readme/CONTRIBUTORS.md b/account_chart_update/readme/CONTRIBUTORS.md new file mode 100644 index 00000000000..05650a675d0 --- /dev/null +++ b/account_chart_update/readme/CONTRIBUTORS.md @@ -0,0 +1,11 @@ +- [Tecnativa](https://www.tecnativa.com): + - Pedro M. Baeza + - Ernesto Tejeda +- Jacques-Etienne Baudoux \<\> +- Sylvain Van Hoof \<\> +- Nacho Muñoz \<\> +- Alberto Martín - Guadaltech \<\> +- Fernando La Chica - GreenIce \<\> +- Jairo Llopis () +- [Factor Libre](https://factorlibre.com): + - Luis J. Salvatierra diff --git a/account_chart_update/readme/CONTRIBUTORS.rst b/account_chart_update/readme/CONTRIBUTORS.rst deleted file mode 100644 index 6ba92f4e125..00000000000 --- a/account_chart_update/readme/CONTRIBUTORS.rst +++ /dev/null @@ -1,14 +0,0 @@ -* `Tecnativa `_: - - * Pedro M. Baeza - * Ernesto Tejeda - -* Jacques-Etienne Baudoux -* Sylvain Van Hoof -* Nacho Muñoz -* Alberto Martín - Guadaltech -* Fernando La Chica - GreenIce -* Jairo Llopis (https://www.moduon.team/) -* `Factor Libre `_: - - * Luis J. Salvatierra diff --git a/account_chart_update/readme/DESCRIPTION.md b/account_chart_update/readme/DESCRIPTION.md new file mode 100644 index 00000000000..9dd97ad2b5b --- /dev/null +++ b/account_chart_update/readme/DESCRIPTION.md @@ -0,0 +1,12 @@ +This is a pretty useful tool to update Odoo installations after tax +reforms on the official charts of accounts, or to apply fixes performed +on the chart template. + +The wizard: + +- Allows the user to compare a chart and a template showing differences + on accounts, taxes, tax codes and fiscal positions. +- It may create the new account, taxes, tax codes and fiscal positions + detected on the template. +- It can also update (overwrite) the accounts, taxes, tax codes and + fiscal positions that got modified on the template. diff --git a/account_chart_update/readme/DESCRIPTION.rst b/account_chart_update/readme/DESCRIPTION.rst deleted file mode 100644 index 16bcfce38d4..00000000000 --- a/account_chart_update/readme/DESCRIPTION.rst +++ /dev/null @@ -1,12 +0,0 @@ -This is a pretty useful tool to update Odoo installations after tax reforms -on the official charts of accounts, or to apply fixes performed on the chart -template. - -The wizard: - -* Allows the user to compare a chart and a template showing differences - on accounts, taxes, tax codes and fiscal positions. -* It may create the new account, taxes, tax codes and fiscal positions detected - on the template. -* It can also update (overwrite) the accounts, taxes, tax codes and fiscal - positions that got modified on the template. diff --git a/account_chart_update/readme/ROADMAP.md b/account_chart_update/readme/ROADMAP.md new file mode 100644 index 00000000000..945d105a07a --- /dev/null +++ b/account_chart_update/readme/ROADMAP.md @@ -0,0 +1,5 @@ +- Generate and update account reconcile models. +- Generate XML-ID for fiscal position tax and account mapping lines. +- Allow to select independently operations to perform (create, update, + deactivate). +- Detect fiscal positions to deactivate? diff --git a/account_chart_update/readme/ROADMAP.rst b/account_chart_update/readme/ROADMAP.rst deleted file mode 100644 index 40b5a6a8a13..00000000000 --- a/account_chart_update/readme/ROADMAP.rst +++ /dev/null @@ -1,5 +0,0 @@ -* Generate and update account reconcile models. -* Generate XML-ID for fiscal position tax and account mapping lines. -* Allow to select independently operations to perform (create, update, - deactivate). -* Detect fiscal positions to deactivate? diff --git a/account_chart_update/readme/USAGE.md b/account_chart_update/readme/USAGE.md new file mode 100644 index 00000000000..7989f8c652b --- /dev/null +++ b/account_chart_update/readme/USAGE.md @@ -0,0 +1,8 @@ +The wizard, accesible from *Accounting \> Settings \> Update Chart +Template*, lets the user select what kind of objects must be +checked/updated, and whether old records must be checked for changes and +updates. + +It will display all the objects to be created / updated / deactivated +with some information about the detected differences, and allow the user +to exclude records individually. diff --git a/account_chart_update/readme/USAGE.rst b/account_chart_update/readme/USAGE.rst deleted file mode 100644 index f08aabe420d..00000000000 --- a/account_chart_update/readme/USAGE.rst +++ /dev/null @@ -1,7 +0,0 @@ -The wizard, accesible from *Accounting > Settings > Update Chart Template*, -lets the user select what kind of objects must be checked/updated, and whether -old records must be checked for changes and updates. - -It will display all the objects to be created / updated / deactivated with some -information about the detected differences, and allow the user to exclude -records individually. diff --git a/account_chart_update/static/description/index.html b/account_chart_update/static/description/index.html index 526ad6cf7b9..3b78bebaed4 100644 --- a/account_chart_update/static/description/index.html +++ b/account_chart_update/static/description/index.html @@ -369,18 +369,18 @@

Detect changes and update the Account Chart from a template -

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

-

This is a pretty useful tool to update Odoo installations after tax reforms -on the official charts of accounts, or to apply fixes performed on the chart -template.

+

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

+

This is a pretty useful tool to update Odoo installations after tax +reforms on the official charts of accounts, or to apply fixes performed +on the chart template.

The wizard:

  • Allows the user to compare a chart and a template showing differences on accounts, taxes, tax codes and fiscal positions.
  • -
  • It may create the new account, taxes, tax codes and fiscal positions detected -on the template.
  • -
  • It can also update (overwrite) the accounts, taxes, tax codes and fiscal -positions that got modified on the template.
  • +
  • It may create the new account, taxes, tax codes and fiscal positions +detected on the template.
  • +
  • It can also update (overwrite) the accounts, taxes, tax codes and +fiscal positions that got modified on the template.

Table of contents

@@ -398,12 +398,13 @@

Detect changes and update the Account Chart from a template

Usage

-

The wizard, accesible from Accounting > Settings > Update Chart Template, -lets the user select what kind of objects must be checked/updated, and whether -old records must be checked for changes and updates.

-

It will display all the objects to be created / updated / deactivated with some -information about the detected differences, and allow the user to exclude -records individually.

+

The wizard, accesible from Accounting > Settings > Update Chart +Template, lets the user select what kind of objects must be +checked/updated, and whether old records must be checked for changes and +updates.

+

It will display all the objects to be created / updated / deactivated +with some information about the detected differences, and allow the user +to exclude records individually.

Known issues / Roadmap

@@ -420,7 +421,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.

@@ -462,7 +463,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-financial-tools project on GitHub.

+

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/tests/common.py b/account_chart_update/tests/common.py index 6d2b695a327..054a94d3b37 100644 --- a/account_chart_update/tests/common.py +++ b/account_chart_update/tests/common.py @@ -11,7 +11,7 @@ def _create_xml_id(cls, record): return cls.env["ir.model.data"].create( { "module": "account_chart_update", - "name": "{}-{}".format(record._table, record.id), + "name": f"{record._table}-{record.id}", "model": record._name, "res_id": record.id, } diff --git a/account_chart_update/tests/test_account_chart_update.py b/account_chart_update/tests/test_account_chart_update.py index b3cdfe6573b..7ac43b6f7d0 100644 --- a/account_chart_update/tests/test_account_chart_update.py +++ b/account_chart_update/tests/test_account_chart_update.py @@ -22,12 +22,10 @@ def test_chart_update(self): field = wizard.fp_field_ids[:1] name = field.with_context(account_chart_update=True).name_get()[0] self.assertEqual(name[0], field.id) - self.assertEqual(name[1], "{} ({})".format(field.field_description, field.name)) + self.assertEqual(name[1], f"{field.field_description} ({field.name})") name = field.name_get()[0] self.assertEqual(name[0], field.id) - self.assertEqual( - name[1], "{} ({})".format(field.field_description, field.model) - ) + self.assertEqual(name[1], f"{field.field_description} ({field.model})") # Test no changes self.assertEqual(wizard.state, "ready") self.assertFalse(wizard.tax_ids) @@ -361,7 +359,7 @@ def test_00_matching(self): expected_xmlid = "{}.{}_{}".format( "account_chart_update", wizard.company_id.id, - "account_fiscal_position_template-{}".format(self.fp_template.id), + f"account_fiscal_position_template-{self.fp_template.id}", ) self.assertEqual(fp_rec.get_external_id().get(fp_id), expected_xmlid) wizard.unlink() diff --git a/account_chart_update/wizard/wizard_chart_update.py b/account_chart_update/wizard/wizard_chart_update.py index 6d3949247f0..2913d307218 100644 --- a/account_chart_update/wizard/wizard_chart_update.py +++ b/account_chart_update/wizard/wizard_chart_update.py @@ -1129,9 +1129,7 @@ def _update_taxes(self): new_tax = self.env["account.tax"].browse( template_to_tax_dict[wiz_tax.tax_id.id] ) - _logger.info( - _("Created tax %s."), "'{}' (ID:{})".format(new_tax.name, new_tax.id) - ) + _logger.info(_("Created tax %s."), f"'{new_tax.name}' (ID:{new_tax.id})") for wiz_tax in self.tax_ids.filtered(lambda x: x.type != "new"): template, tax = wiz_tax.tax_id, wiz_tax.update_tax_id # Deactivate tax @@ -1192,7 +1190,7 @@ def _update_accounts(self): else: # pragma: no cover _logger.exception( "ERROR: " + _("Exception creating account %s."), - "'{} - {}'".format(template.code, template.name), + f"'{template.code} - {template.name}'", ) if not self.continue_on_errors: break @@ -1206,7 +1204,7 @@ def _update_accounts(self): account[key] = value _logger.info( _("Updated account %s."), - "'{} - {}'".format(account.code, account.name), + f"'{account.code} - {account.name}'", ) if self.recreate_xml_ids and self.missing_xml_id( template, account @@ -1214,7 +1212,7 @@ def _update_accounts(self): self.recreate_xml_id(template, account) _logger.info( _("Updated account %s. (Recreated XML-ID)"), - "'{} - {}'".format(account.code, account.name), + f"'{account.code} - {account.name}'", ) except Exception: @@ -1224,7 +1222,7 @@ def _update_accounts(self): else: # pragma: no cover _logger.exception( "ERROR: " + _("Exception writing account %s."), - "'{} - {}'".format(account.code, account.name), + f"'{account.code} - {account.name}'", ) if not self.continue_on_errors: break @@ -1516,7 +1514,7 @@ def _selection_from_files(self, model_name, field_opts): for opt in field_opts: model = self.env[model_name] desc = model._fields[opt].get_description(self.env)["string"] - result.append((opt, "{} ({})".format(desc, opt))) + result.append((opt, f"{desc} ({opt})")) return result