diff --git a/account_account_tag_code/README.rst b/account_account_tag_code/README.rst new file mode 100644 index 00000000000..e28459f4ba1 --- /dev/null +++ b/account_account_tag_code/README.rst @@ -0,0 +1,84 @@ +======================== +Account Account Tag Code +======================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:d45eabc8c23d4188a31b402cc4458bc0585b53375309c15c6c44b2cc1b2813d8 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/18.0/account_account_tag_code + :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-18-0/account-financial-tools-18-0-account_account_tag_code + :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=18.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module adds a field 'code' to model 'account.account.tag'. This +field 'code' is useful to search specific tags without having problems +with the translations. + +**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 to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* ForgeFlow + +Contributors +------------ + +- ForgeFlow +- Marina Alapont <> +- `APSL `__: + + - Antoni Marroig <> + +- ``Heliconia Solutions Pvt. Ltd. ``\ \_ + +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. + +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_account_tag_code/__init__.py b/account_account_tag_code/__init__.py new file mode 100644 index 00000000000..0650744f6bc --- /dev/null +++ b/account_account_tag_code/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/account_account_tag_code/__manifest__.py b/account_account_tag_code/__manifest__.py new file mode 100644 index 00000000000..56cc644f8c3 --- /dev/null +++ b/account_account_tag_code/__manifest__.py @@ -0,0 +1,13 @@ +# Copyright 2023 ForgeFlow S.L. +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Account Account Tag Code", + "summary": "Add a code field to the accounts tags", + "version": "18.0.1.0.0", + "license": "AGPL-3", + "author": "ForgeFlow,Odoo Community Association (OCA)", + "website": "https://github.com/OCA/account-financial-tools", + "depends": ["account", "account_usability"], + "data": ["views/account_account_tag_views.xml"], +} diff --git a/account_account_tag_code/i18n/account_account_tag_code.pot b/account_account_tag_code/i18n/account_account_tag_code.pot new file mode 100644 index 00000000000..66c8578b9f6 --- /dev/null +++ b/account_account_tag_code/i18n/account_account_tag_code.pot @@ -0,0 +1,24 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_account_tag_code +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 17.0\n" +"Report-Msgid-Bugs-To: \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_account_tag_code +#: model:ir.model,name:account_account_tag_code.model_account_account_tag +msgid "Account Tag" +msgstr "" + +#. module: account_account_tag_code +#: model:ir.model.fields,field_description:account_account_tag_code.field_account_account_tag__code +msgid "Code" +msgstr "" diff --git a/account_account_tag_code/i18n/es.po b/account_account_tag_code/i18n/es.po new file mode 100644 index 00000000000..b32c285c7d0 --- /dev/null +++ b/account_account_tag_code/i18n/es.po @@ -0,0 +1,27 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_account_tag_code +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-02-16 21:35+0000\n" +"Last-Translator: Ivorra78 \n" +"Language-Team: none\n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.17\n" + +#. module: account_account_tag_code +#: model:ir.model,name:account_account_tag_code.model_account_account_tag +msgid "Account Tag" +msgstr "Etiqueta de Cuenta" + +#. module: account_account_tag_code +#: model:ir.model.fields,field_description:account_account_tag_code.field_account_account_tag__code +msgid "Code" +msgstr "Código" diff --git a/account_account_tag_code/i18n/it.po b/account_account_tag_code/i18n/it.po new file mode 100644 index 00000000000..0bb69f0e2c9 --- /dev/null +++ b/account_account_tag_code/i18n/it.po @@ -0,0 +1,27 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_account_tag_code +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-02-26 16:36+0000\n" +"Last-Translator: mymage \n" +"Language-Team: none\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.17\n" + +#. module: account_account_tag_code +#: model:ir.model,name:account_account_tag_code.model_account_account_tag +msgid "Account Tag" +msgstr "Etichetta conto" + +#. module: account_account_tag_code +#: model:ir.model.fields,field_description:account_account_tag_code.field_account_account_tag__code +msgid "Code" +msgstr "Codice" diff --git a/account_account_tag_code/models/__init__.py b/account_account_tag_code/models/__init__.py new file mode 100644 index 00000000000..1977e324e60 --- /dev/null +++ b/account_account_tag_code/models/__init__.py @@ -0,0 +1 @@ +from . import account_account_tag diff --git a/account_account_tag_code/models/account_account_tag.py b/account_account_tag_code/models/account_account_tag.py new file mode 100644 index 00000000000..6d6b85b0e90 --- /dev/null +++ b/account_account_tag_code/models/account_account_tag.py @@ -0,0 +1,15 @@ +from odoo import api, fields, models + + +class AccountAccountTag(models.Model): + _inherit = "account.account.tag" + + code = fields.Char() + + @api.depends("code") + def _compute_display_name(self): + for tag in self: + if tag.code: + tag.display_name = f"[{tag.code}] {tag.name}" + else: + tag.display_name = tag.name diff --git a/account_account_tag_code/pyproject.toml b/account_account_tag_code/pyproject.toml new file mode 100644 index 00000000000..4231d0cccb3 --- /dev/null +++ b/account_account_tag_code/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/account_account_tag_code/readme/CONTRIBUTORS.md b/account_account_tag_code/readme/CONTRIBUTORS.md new file mode 100644 index 00000000000..322bc45c4b2 --- /dev/null +++ b/account_account_tag_code/readme/CONTRIBUTORS.md @@ -0,0 +1,5 @@ +- ForgeFlow +- Marina Alapont \<\<\>\> +- [APSL](): + - Antoni Marroig \<\<\>\> +- `Heliconia Solutions Pvt. Ltd. `_ diff --git a/account_account_tag_code/readme/DESCRIPTION.md b/account_account_tag_code/readme/DESCRIPTION.md new file mode 100644 index 00000000000..931a9259f05 --- /dev/null +++ b/account_account_tag_code/readme/DESCRIPTION.md @@ -0,0 +1,2 @@ +This module adds a field 'code' to model 'account.account.tag'. +This field 'code' is useful to search specific tags without having problems with the translations. \ No newline at end of file diff --git a/account_account_tag_code/static/description/icon.png b/account_account_tag_code/static/description/icon.png new file mode 100644 index 00000000000..3a0328b516c Binary files /dev/null and b/account_account_tag_code/static/description/icon.png differ diff --git a/account_account_tag_code/static/description/index.html b/account_account_tag_code/static/description/index.html new file mode 100644 index 00000000000..92a291a1477 --- /dev/null +++ b/account_account_tag_code/static/description/index.html @@ -0,0 +1,124 @@ +
+
+
+

Module name

+

This module was written to extend the functionality of ... to support ... and allow you to ...

+
+
+
+ +
+
+
+

Installation

+
+
+

To install this module, you need to: +

    +
  • ...
  • +
+

+
+
+
+ + + +
+
+
+
+ +
+
+
+

Configuration

+
+
+

To configure this module, you need to: +

    +
  • ...
  • +
+

+
+
+
+ + + +
+
+
+
+ +
+
+
+

Usage

+
+
+

To use this module, you need to: +

    +
  • ...
  • +
+

+

For further information, please visit: +

+

+
+
+
+ + + +
+
+
+
+ +
+
+
+

Known issues / Roadmap

+
+
+

+

    +
  • ...
  • +
+

+
+
+
+ + + +
+
+
+
+ +
+
+
+

Credits

+
+
+

Contributors

+ +
+
+

Maintainer

+

+ This module is maintained by the OCA.
+ 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.
+ To contribute to this module, please visit http://odoo-community.org.
+ +

+
+
+
\ No newline at end of file diff --git a/account_account_tag_code/tests/__init__.py b/account_account_tag_code/tests/__init__.py new file mode 100644 index 00000000000..d1e300e4f81 --- /dev/null +++ b/account_account_tag_code/tests/__init__.py @@ -0,0 +1 @@ +from . import test_account_tag_display_name diff --git a/account_account_tag_code/tests/test_account_tag_display_name.py b/account_account_tag_code/tests/test_account_tag_display_name.py new file mode 100644 index 00000000000..9318d00ebcb --- /dev/null +++ b/account_account_tag_code/tests/test_account_tag_display_name.py @@ -0,0 +1,26 @@ +# Copyright 2014-2022 Acsone (http://acsone.eu) +# Copyright 2016-2022 Akretion (http://www.akretion.com/) +# @author Stéphane Bidoul +# @author Alexis de Lattre +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + + +from odoo.tests.common import TransactionCase + + +class TestAccountTag(TransactionCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.tag = cls.env["account.account.tag"].create( + { + "name": "Test Tag Name", + } + ) + + def test_display_name_without_code(self): + self.assertEqual(self.tag.display_name, self.tag.name) + + def test_display_name_with_code(self): + self.tag.code = "Test" + self.assertEqual(self.tag.display_name, f"[{self.tag.code}] {self.tag.name}") diff --git a/account_account_tag_code/views/account_account_tag_views.xml b/account_account_tag_code/views/account_account_tag_views.xml new file mode 100644 index 00000000000..5b613f3dc8e --- /dev/null +++ b/account_account_tag_code/views/account_account_tag_views.xml @@ -0,0 +1,24 @@ + + + + account.tag.view.form.code + account.account.tag + + + + + + + + + + account.tag.view.tree.code + account.account.tag + + + + + + + +