From 5a73f68875b937d72cf80c9d546e3c90c6ce880f Mon Sep 17 00:00:00 2001 From: "Yadier A. De Quesada" Date: Sun, 9 Jul 2023 16:17:31 -0400 Subject: [PATCH] [ADD] account_analytic_tag Restore account.analytic.tag --- account_analytic_tag/README.rst | 96 ++++++++++ account_analytic_tag/__init__.py | 1 + account_analytic_tag/__manifest__.py | 19 ++ .../i18n/account_analytic_tag.pot | 165 ++++++++++++++++++ account_analytic_tag/i18n/en_US.po | 165 ++++++++++++++++++ account_analytic_tag/i18n/es.po | 165 ++++++++++++++++++ account_analytic_tag/models/__init__.py | 1 + .../models/account_analytic_tag.py | 53 ++++++ account_analytic_tag/readme/CONFIGURE.rst | 3 + account_analytic_tag/readme/CONTRIBUTORS.rst | 1 + account_analytic_tag/readme/CREDITS.rst | 0 account_analytic_tag/readme/DESCRIPTION.rst | 1 + account_analytic_tag/readme/USAGE.rst | 4 + .../security/analytic_security.xml | 22 +++ .../security/ir.model.access.csv | 3 + .../views/account_analytic_tag_views.xml | 86 +++++++++ .../odoo/addons/account_analytic_tag | 1 + setup/account_analytic_tag/setup.py | 6 + 18 files changed, 792 insertions(+) create mode 100644 account_analytic_tag/README.rst create mode 100644 account_analytic_tag/__init__.py create mode 100644 account_analytic_tag/__manifest__.py create mode 100644 account_analytic_tag/i18n/account_analytic_tag.pot create mode 100644 account_analytic_tag/i18n/en_US.po create mode 100644 account_analytic_tag/i18n/es.po create mode 100644 account_analytic_tag/models/__init__.py create mode 100644 account_analytic_tag/models/account_analytic_tag.py create mode 100644 account_analytic_tag/readme/CONFIGURE.rst create mode 100644 account_analytic_tag/readme/CONTRIBUTORS.rst create mode 100644 account_analytic_tag/readme/CREDITS.rst create mode 100644 account_analytic_tag/readme/DESCRIPTION.rst create mode 100644 account_analytic_tag/readme/USAGE.rst create mode 100644 account_analytic_tag/security/analytic_security.xml create mode 100644 account_analytic_tag/security/ir.model.access.csv create mode 100644 account_analytic_tag/views/account_analytic_tag_views.xml create mode 120000 setup/account_analytic_tag/odoo/addons/account_analytic_tag create mode 100644 setup/account_analytic_tag/setup.py diff --git a/account_analytic_tag/README.rst b/account_analytic_tag/README.rst new file mode 100644 index 0000000000..c937222864 --- /dev/null +++ b/account_analytic_tag/README.rst @@ -0,0 +1,96 @@ +==================== +Account Analytic Tag +==================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:833567d2eec160462d016e1141e479a2415360fe597ce75c518d683898997612 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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--analytic-lightgray.png?logo=github + :target: https://github.com/OCA/account-analytic/tree/16.0/account_analytic_tag + :alt: OCA/account-analytic +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/account-analytic-16-0/account-analytic-16-0-account_analytic_tag + :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-analytic&target_branch=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module adds *account analytic tags* on accounts. + +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + +Example: + +If you want to use analytic account tags ... + +Usage +===== + +Analytical tags. +This function allows you to create formulas to establish the distribution of prices +between analytical accounts. This means that when we create an analytics tag, +we must establish an Analytical Account to which it is directed and the monetary percentage. + +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 +~~~~~~~ + +* Tecnativa + +Contributors +~~~~~~~~~~~~ + +* Yadier Quesada - Tecnativa + +Other credits +~~~~~~~~~~~~~ + + + +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-analytic `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/account_analytic_tag/__init__.py b/account_analytic_tag/__init__.py new file mode 100644 index 0000000000..0650744f6b --- /dev/null +++ b/account_analytic_tag/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/account_analytic_tag/__manifest__.py b/account_analytic_tag/__manifest__.py new file mode 100644 index 0000000000..b24f2fc78e --- /dev/null +++ b/account_analytic_tag/__manifest__.py @@ -0,0 +1,19 @@ +# Copyright 2023 Tecnativa - Yadier Quesada (https://www.tecnativa.com/) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +{ + "name": "Account Analytic Tag", + "version": "16.0.1.0.0", + "author": "Tecnativa, Odoo Community Association (OCA)", + "category": "Account", + "website": "https://github.com/OCA/account-analytic", + "depends": ["analytic"], + "data": [ + "security/analytic_security.xml", + "security/ir.model.access.csv", + "views/account_analytic_tag_views.xml", + ], + "license": "AGPL-3", + "installable": True, + "application": False, +} diff --git a/account_analytic_tag/i18n/account_analytic_tag.pot b/account_analytic_tag/i18n/account_analytic_tag.pot new file mode 100644 index 0000000000..3b0b6b876e --- /dev/null +++ b/account_analytic_tag/i18n/account_analytic_tag.pot @@ -0,0 +1,165 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_analytic_tag +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0-20230706\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-07-09 23:36+0000\n" +"PO-Revision-Date: 2023-07-09 23:36+0000\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_analytic_tag +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_tag__active +msgid "Active" +msgstr "" + +#. module: account_analytic_tag +#: model_terms:ir.actions.act_window,help:account_analytic_tag.account_analytic_tag_action +msgid "Add a new tag" +msgstr "" + +#. module: account_analytic_tag +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_distribution__account_id +msgid "Analytic Account" +msgstr "" + +#. module: account_analytic_tag +#: model:ir.model,name:account_analytic_tag.model_account_analytic_distribution +msgid "Analytic Account Distribution" +msgstr "" + +#. module: account_analytic_tag +#: model:res.groups,name:account_analytic_tag.group_analytic_tags +msgid "Analytic Accounting Tags" +msgstr "" + +#. module: account_analytic_tag +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_tag__analytic_distribution_ids +msgid "Analytic Accounts" +msgstr "" + +#. module: account_analytic_tag +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_tag__active_analytic_distribution +#: model_terms:ir.ui.view,arch_db:account_analytic_tag.account_analytic_tag_form_view +msgid "Analytic Distribution" +msgstr "" + +#. module: account_analytic_tag +#: model:ir.model,name:account_analytic_tag.model_account_analytic_line +msgid "Analytic Line" +msgstr "" + +#. module: account_analytic_tag +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_tag__name +msgid "Analytic Tag" +msgstr "" + +#. module: account_analytic_tag +#: model:ir.actions.act_window,name:account_analytic_tag.account_analytic_tag_action +#: model:ir.model,name:account_analytic_tag.model_account_analytic_tag +#: model:ir.ui.menu,name:account_analytic_tag.account_analytic_tag_menu +#: model_terms:ir.ui.view,arch_db:account_analytic_tag.account_analytic_tag_form_view +#: model_terms:ir.ui.view,arch_db:account_analytic_tag.account_analytic_tag_tree_view +msgid "Analytic Tags" +msgstr "" + +#. module: account_analytic_tag +#: model_terms:ir.ui.view,arch_db:account_analytic_tag.account_analytic_tag_form_view +#: model_terms:ir.ui.view,arch_db:account_analytic_tag.account_analytic_tag_view_search +msgid "Archived" +msgstr "" + +#. module: account_analytic_tag +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_tag__color +msgid "Color Index" +msgstr "" + +#. module: account_analytic_tag +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_tag__company_id +msgid "Company" +msgstr "" + +#. module: account_analytic_tag +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_distribution__create_uid +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_tag__create_uid +msgid "Created by" +msgstr "" + +#. module: account_analytic_tag +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_distribution__create_date +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_tag__create_date +msgid "Created on" +msgstr "" + +#. module: account_analytic_tag +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_distribution__display_name +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_tag__display_name +msgid "Display Name" +msgstr "" + +#. module: account_analytic_tag +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_distribution__id +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_tag__id +msgid "ID" +msgstr "" + +#. module: account_analytic_tag +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_distribution____last_update +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_tag____last_update +msgid "Last Modified on" +msgstr "" + +#. module: account_analytic_tag +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_distribution__write_uid +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_tag__write_uid +msgid "Last Updated by" +msgstr "" + +#. module: account_analytic_tag +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_distribution__write_date +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_tag__write_date +msgid "Last Updated on" +msgstr "" + +#. module: account_analytic_tag +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_distribution__name +msgid "Name" +msgstr "" + +#. module: account_analytic_tag +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_distribution__tag_id +msgid "Parent tag" +msgstr "" + +#. module: account_analytic_tag +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_distribution__percentage +msgid "Percentage" +msgstr "" + +#. module: account_analytic_tag +#: model_terms:ir.ui.view,arch_db:account_analytic_tag.account_analytic_tag_view_search +msgid "Search Analytic Tags" +msgstr "" + +#. module: account_analytic_tag +#: model:ir.model.fields,help:account_analytic_tag.field_account_analytic_tag__active +msgid "Set active to false to hide the Analytic Tag without removing it." +msgstr "" + +#. module: account_analytic_tag +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_line__tag_ids +msgid "Tags" +msgstr "" + +#. module: account_analytic_tag +#: model:ir.model.constraint,message:account_analytic_tag.constraint_account_analytic_distribution_check_percentage +msgid "" +"The percentage of an analytic distribution should be between 0 and 100." +msgstr "" diff --git a/account_analytic_tag/i18n/en_US.po b/account_analytic_tag/i18n/en_US.po new file mode 100644 index 0000000000..3b0b6b876e --- /dev/null +++ b/account_analytic_tag/i18n/en_US.po @@ -0,0 +1,165 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_analytic_tag +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0-20230706\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-07-09 23:36+0000\n" +"PO-Revision-Date: 2023-07-09 23:36+0000\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_analytic_tag +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_tag__active +msgid "Active" +msgstr "" + +#. module: account_analytic_tag +#: model_terms:ir.actions.act_window,help:account_analytic_tag.account_analytic_tag_action +msgid "Add a new tag" +msgstr "" + +#. module: account_analytic_tag +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_distribution__account_id +msgid "Analytic Account" +msgstr "" + +#. module: account_analytic_tag +#: model:ir.model,name:account_analytic_tag.model_account_analytic_distribution +msgid "Analytic Account Distribution" +msgstr "" + +#. module: account_analytic_tag +#: model:res.groups,name:account_analytic_tag.group_analytic_tags +msgid "Analytic Accounting Tags" +msgstr "" + +#. module: account_analytic_tag +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_tag__analytic_distribution_ids +msgid "Analytic Accounts" +msgstr "" + +#. module: account_analytic_tag +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_tag__active_analytic_distribution +#: model_terms:ir.ui.view,arch_db:account_analytic_tag.account_analytic_tag_form_view +msgid "Analytic Distribution" +msgstr "" + +#. module: account_analytic_tag +#: model:ir.model,name:account_analytic_tag.model_account_analytic_line +msgid "Analytic Line" +msgstr "" + +#. module: account_analytic_tag +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_tag__name +msgid "Analytic Tag" +msgstr "" + +#. module: account_analytic_tag +#: model:ir.actions.act_window,name:account_analytic_tag.account_analytic_tag_action +#: model:ir.model,name:account_analytic_tag.model_account_analytic_tag +#: model:ir.ui.menu,name:account_analytic_tag.account_analytic_tag_menu +#: model_terms:ir.ui.view,arch_db:account_analytic_tag.account_analytic_tag_form_view +#: model_terms:ir.ui.view,arch_db:account_analytic_tag.account_analytic_tag_tree_view +msgid "Analytic Tags" +msgstr "" + +#. module: account_analytic_tag +#: model_terms:ir.ui.view,arch_db:account_analytic_tag.account_analytic_tag_form_view +#: model_terms:ir.ui.view,arch_db:account_analytic_tag.account_analytic_tag_view_search +msgid "Archived" +msgstr "" + +#. module: account_analytic_tag +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_tag__color +msgid "Color Index" +msgstr "" + +#. module: account_analytic_tag +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_tag__company_id +msgid "Company" +msgstr "" + +#. module: account_analytic_tag +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_distribution__create_uid +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_tag__create_uid +msgid "Created by" +msgstr "" + +#. module: account_analytic_tag +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_distribution__create_date +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_tag__create_date +msgid "Created on" +msgstr "" + +#. module: account_analytic_tag +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_distribution__display_name +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_tag__display_name +msgid "Display Name" +msgstr "" + +#. module: account_analytic_tag +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_distribution__id +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_tag__id +msgid "ID" +msgstr "" + +#. module: account_analytic_tag +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_distribution____last_update +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_tag____last_update +msgid "Last Modified on" +msgstr "" + +#. module: account_analytic_tag +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_distribution__write_uid +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_tag__write_uid +msgid "Last Updated by" +msgstr "" + +#. module: account_analytic_tag +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_distribution__write_date +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_tag__write_date +msgid "Last Updated on" +msgstr "" + +#. module: account_analytic_tag +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_distribution__name +msgid "Name" +msgstr "" + +#. module: account_analytic_tag +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_distribution__tag_id +msgid "Parent tag" +msgstr "" + +#. module: account_analytic_tag +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_distribution__percentage +msgid "Percentage" +msgstr "" + +#. module: account_analytic_tag +#: model_terms:ir.ui.view,arch_db:account_analytic_tag.account_analytic_tag_view_search +msgid "Search Analytic Tags" +msgstr "" + +#. module: account_analytic_tag +#: model:ir.model.fields,help:account_analytic_tag.field_account_analytic_tag__active +msgid "Set active to false to hide the Analytic Tag without removing it." +msgstr "" + +#. module: account_analytic_tag +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_line__tag_ids +msgid "Tags" +msgstr "" + +#. module: account_analytic_tag +#: model:ir.model.constraint,message:account_analytic_tag.constraint_account_analytic_distribution_check_percentage +msgid "" +"The percentage of an analytic distribution should be between 0 and 100." +msgstr "" diff --git a/account_analytic_tag/i18n/es.po b/account_analytic_tag/i18n/es.po new file mode 100644 index 0000000000..8b826c48fb --- /dev/null +++ b/account_analytic_tag/i18n/es.po @@ -0,0 +1,165 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_analytic_tag +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0-20230706\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-07-09 23:33+0000\n" +"PO-Revision-Date: 2023-07-09 23:33+0000\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_analytic_tag +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_tag__active +msgid "Active" +msgstr "" + +#. module: account_analytic_tag +#: model_terms:ir.actions.act_window,help:account_analytic_tag.account_analytic_tag_action +msgid "Add a new tag" +msgstr "Agregar nueva etiqueta" + +#. module: account_analytic_tag +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_distribution__account_id +msgid "Analytic Account" +msgstr "Cuenta Analítica" + +#. module: account_analytic_tag +#: model:ir.model,name:account_analytic_tag.model_account_analytic_distribution +msgid "Analytic Account Distribution" +msgstr "Distribución de cuentas analíticas" + +#. module: account_analytic_tag +#: model:res.groups,name:account_analytic_tag.group_analytic_tags +msgid "Analytic Accounting Tags" +msgstr "Etiquetas de contabilidad analítica" + +#. module: account_analytic_tag +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_tag__analytic_distribution_ids +msgid "Analytic Accounts" +msgstr "Cuentas Analíticas" + +#. module: account_analytic_tag +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_tag__active_analytic_distribution +#: model_terms:ir.ui.view,arch_db:account_analytic_tag.account_analytic_tag_form_view +msgid "Analytic Distribution" +msgstr "Distribución Analítica" + +#. module: account_analytic_tag +#: model:ir.model,name:account_analytic_tag.model_account_analytic_line +msgid "Analytic Line" +msgstr "Línea Analítica" + +#. module: account_analytic_tag +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_tag__name +msgid "Analytic Tag" +msgstr "Etiqueta Analítica" + +#. module: account_analytic_tag +#: model:ir.actions.act_window,name:account_analytic_tag.account_analytic_tag_action +#: model:ir.model,name:account_analytic_tag.model_account_analytic_tag +#: model:ir.ui.menu,name:account_analytic_tag.account_analytic_tag_menu +#: model_terms:ir.ui.view,arch_db:account_analytic_tag.account_analytic_tag_form_view +#: model_terms:ir.ui.view,arch_db:account_analytic_tag.account_analytic_tag_tree_view +msgid "Analytic Tags" +msgstr "Etiquetas Analíticas" + +#. module: account_analytic_tag +#: model_terms:ir.ui.view,arch_db:account_analytic_tag.account_analytic_tag_form_view +#: model_terms:ir.ui.view,arch_db:account_analytic_tag.account_analytic_tag_view_search +msgid "Archived" +msgstr "Archivado" + +#. module: account_analytic_tag +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_tag__color +msgid "Color Index" +msgstr "Indice de color" + +#. module: account_analytic_tag +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_tag__company_id +msgid "Company" +msgstr "Compañía" + +#. module: account_analytic_tag +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_distribution__create_uid +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_tag__create_uid +msgid "Created by" +msgstr "Creado por" + +#. module: account_analytic_tag +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_distribution__create_date +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_tag__create_date +msgid "Created on" +msgstr "Creado en" + +#. module: account_analytic_tag +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_distribution__display_name +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_tag__display_name +msgid "Display Name" +msgstr "Nombre a mostrar" + +#. module: account_analytic_tag +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_distribution__id +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_tag__id +msgid "ID" +msgstr "" + +#. module: account_analytic_tag +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_distribution____last_update +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_tag____last_update +msgid "Last Modified on" +msgstr "Última modificación el" + +#. module: account_analytic_tag +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_distribution__write_uid +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_tag__write_uid +msgid "Last Updated by" +msgstr "Última actualización por" + +#. module: account_analytic_tag +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_distribution__write_date +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_tag__write_date +msgid "Last Updated on" +msgstr "Ultima actualización en" + +#. module: account_analytic_tag +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_distribution__name +msgid "Name" +msgstr "Nombre" + +#. module: account_analytic_tag +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_distribution__tag_id +msgid "Parent tag" +msgstr "Etiqueta padre" + +#. module: account_analytic_tag +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_distribution__percentage +msgid "Percentage" +msgstr "Porcentaje" + +#. module: account_analytic_tag +#: model_terms:ir.ui.view,arch_db:account_analytic_tag.account_analytic_tag_view_search +msgid "Search Analytic Tags" +msgstr "Buscar etiquetas analíticas" + +#. module: account_analytic_tag +#: model:ir.model.fields,help:account_analytic_tag.field_account_analytic_tag__active +msgid "Set active to false to hide the Analytic Tag without removing it." +msgstr "Establezca activo en falso para ocultar la etiqueta analítica sin eliminarla." + +#. module: account_analytic_tag +#: model:ir.model.fields,field_description:account_analytic_tag.field_account_analytic_line__tag_ids +msgid "Tags" +msgstr "Etiquetas" + +#. module: account_analytic_tag +#: model:ir.model.constraint,message:account_analytic_tag.constraint_account_analytic_distribution_check_percentage +msgid "" +"The percentage of an analytic distribution should be between 0 and 100." +msgstr "El porcentaje de una distribución analítica debe estar entre 0 y 100." diff --git a/account_analytic_tag/models/__init__.py b/account_analytic_tag/models/__init__.py new file mode 100644 index 0000000000..ba3241c138 --- /dev/null +++ b/account_analytic_tag/models/__init__.py @@ -0,0 +1 @@ +from . import account_analytic_tag diff --git a/account_analytic_tag/models/account_analytic_tag.py b/account_analytic_tag/models/account_analytic_tag.py new file mode 100644 index 0000000000..03d44baa3c --- /dev/null +++ b/account_analytic_tag/models/account_analytic_tag.py @@ -0,0 +1,53 @@ +from odoo import fields, models + + +class AccountAnalyticDistribution(models.Model): + _name = "account.analytic.distribution" + _description = "Analytic Account Distribution" + _rec_name = "account_id" + + account_id = fields.Many2one( + "account.analytic.account", string="Analytic Account", required=True + ) + percentage = fields.Float(required=True, default=100.0) + name = fields.Char(related="account_id.name", readonly=False) + tag_id = fields.Many2one("account.analytic.tag", string="Parent tag", required=True) + + _sql_constraints = [ + ( + "check_percentage", + "CHECK(percentage >= 0 AND percentage <= 100)", + "The percentage of an analytic distribution should be between 0 and 100.", + ) + ] + + +class AccountAnalyticTag(models.Model): + _name = "account.analytic.tag" + _description = "Analytic Tags" + + name = fields.Char(string="Analytic Tag", index=True, required=True) + color = fields.Integer("Color Index") + active = fields.Boolean( + default=True, + help="Set active to false to hide the Analytic Tag without removing it.", + ) + active_analytic_distribution = fields.Boolean("Analytic Distribution") + analytic_distribution_ids = fields.One2many( + "account.analytic.distribution", "tag_id", string="Analytic Accounts" + ) + company_id = fields.Many2one("res.company", string="Company") + + +class AccountAnalyticLine(models.Model): + _inherit = "account.analytic.line" + + tag_ids = fields.Many2many( + "account.analytic.tag", + "account_analytic_line_tag_rel", + "line_id", + "tag_id", + string="Tags", + copy=True, + check_company=True, + ) diff --git a/account_analytic_tag/readme/CONFIGURE.rst b/account_analytic_tag/readme/CONFIGURE.rst new file mode 100644 index 0000000000..f7ca2cdf92 --- /dev/null +++ b/account_analytic_tag/readme/CONFIGURE.rst @@ -0,0 +1,3 @@ +Example: + +If you want to use analytic account tags ... diff --git a/account_analytic_tag/readme/CONTRIBUTORS.rst b/account_analytic_tag/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000000..23814b577b --- /dev/null +++ b/account_analytic_tag/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* Yadier Quesada - Tecnativa diff --git a/account_analytic_tag/readme/CREDITS.rst b/account_analytic_tag/readme/CREDITS.rst new file mode 100644 index 0000000000..e69de29bb2 diff --git a/account_analytic_tag/readme/DESCRIPTION.rst b/account_analytic_tag/readme/DESCRIPTION.rst new file mode 100644 index 0000000000..be16f80c70 --- /dev/null +++ b/account_analytic_tag/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +This module adds *account analytic tags* on accounts. diff --git a/account_analytic_tag/readme/USAGE.rst b/account_analytic_tag/readme/USAGE.rst new file mode 100644 index 0000000000..cdb0749bfb --- /dev/null +++ b/account_analytic_tag/readme/USAGE.rst @@ -0,0 +1,4 @@ +Analytical tags. +This function allows you to create formulas to establish the distribution of prices +between analytical accounts. This means that when we create an analytics tag, +we must establish an Analytical Account to which it is directed and the monetary percentage. diff --git a/account_analytic_tag/security/analytic_security.xml b/account_analytic_tag/security/analytic_security.xml new file mode 100644 index 0000000000..28f13c79cb --- /dev/null +++ b/account_analytic_tag/security/analytic_security.xml @@ -0,0 +1,22 @@ + + + + + + Analytic line multi company rule + + + ['|',('company_id','=',False),('company_id', 'in', company_ids)] + + + + + + Analytic Accounting Tags + + + + + diff --git a/account_analytic_tag/security/ir.model.access.csv b/account_analytic_tag/security/ir.model.access.csv new file mode 100644 index 0000000000..acc7636eba --- /dev/null +++ b/account_analytic_tag/security/ir.model.access.csv @@ -0,0 +1,3 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_account_analytic_tag,account.analytic.tag,model_account_analytic_tag,analytic.group_analytic_accounting,1,1,1,1 +access_account_analytic_distribution,account.analytic.distribution,model_account_analytic_distribution,analytic.group_analytic_accounting,1,1,1,1 diff --git a/account_analytic_tag/views/account_analytic_tag_views.xml b/account_analytic_tag/views/account_analytic_tag_views.xml new file mode 100644 index 0000000000..69c2db28e9 --- /dev/null +++ b/account_analytic_tag/views/account_analytic_tag_views.xml @@ -0,0 +1,86 @@ + + + account.analytic.tag.tree + account.analytic.tag + + + + + + + + + + + account.analytic.tag.form + account.analytic.tag + +
+ + + + + + + + + + + + + + + +
+
+
+ + + account.analytic.tag.view.search + account.analytic.tag + + + + + + + + + + + Analytic Tags + account.analytic.tag + tree,form + +

+ Add a new tag +

+
+
+ + +
diff --git a/setup/account_analytic_tag/odoo/addons/account_analytic_tag b/setup/account_analytic_tag/odoo/addons/account_analytic_tag new file mode 120000 index 0000000000..b97585c0c0 --- /dev/null +++ b/setup/account_analytic_tag/odoo/addons/account_analytic_tag @@ -0,0 +1 @@ +../../../../account_analytic_tag \ No newline at end of file diff --git a/setup/account_analytic_tag/setup.py b/setup/account_analytic_tag/setup.py new file mode 100644 index 0000000000..28c57bb640 --- /dev/null +++ b/setup/account_analytic_tag/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)