diff --git a/purchase_tag/README.rst b/purchase_tag/README.rst new file mode 100644 index 00000000000..52673d46b9c --- /dev/null +++ b/purchase_tag/README.rst @@ -0,0 +1,81 @@ +============= +Purchase Tags +============= + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:5a4077180ca35330dc5f9467e43ce635eb0733c8f4b8114917aca5b784833a4a + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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%2Fpurchase--workflow-lightgray.png?logo=github + :target: https://github.com/OCA/purchase-workflow/tree/17.0/purchase_tag + :alt: OCA/purchase-workflow +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/purchase-workflow-17-0/purchase-workflow-17-0-purchase_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/purchase-workflow&target_branch=17.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module allows to add multiple tags to purchase orders + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +To use this module, you need to go to Purchase Orders and select tags. + +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 +------------ + +- Jasmin Solanki + +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/purchase-workflow `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/purchase_tag/__init__.py b/purchase_tag/__init__.py new file mode 100644 index 00000000000..4b76c7b2d5c --- /dev/null +++ b/purchase_tag/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from . import models diff --git a/purchase_tag/__manifest__.py b/purchase_tag/__manifest__.py new file mode 100644 index 00000000000..f8dce1c2dfb --- /dev/null +++ b/purchase_tag/__manifest__.py @@ -0,0 +1,21 @@ +# Copyright 2022 ForgeFlow S.L. +# (http://www.forgeflow.com) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +{ + "name": "Purchase Tags", + "summary": "Allows to add multiple tags to purchase orders", + "version": "17.0.1.0.0", + "author": "ForgeFlow, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/purchase-workflow", + "category": "Purchases", + "depends": ["purchase"], + "data": [ + "security/ir.model.access.csv", + "views/purchase_view.xml", + "views/purchase_tag_view.xml", + ], + "license": "AGPL-3", + "installable": True, + "application": False, +} diff --git a/purchase_tag/i18n/es.po b/purchase_tag/i18n/es.po new file mode 100644 index 00000000000..9217e2dbb43 --- /dev/null +++ b/purchase_tag/i18n/es.po @@ -0,0 +1,90 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * purchase_tag +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-09-03 13:40+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: purchase_tag +#: model:ir.model.fields,field_description:purchase_tag.field_purchase_tag__color +msgid "Color" +msgstr "Color" + +#. module: purchase_tag +#: model_terms:ir.actions.act_window,help:purchase_tag.purchase_tag_action +msgid "Create new tags for your purchase orders" +msgstr "Crea nuevas etiquetas para tus órdenes de compra" + +#. module: purchase_tag +#: model:ir.model.fields,field_description:purchase_tag.field_purchase_tag__create_uid +msgid "Created by" +msgstr "Creado por" + +#. module: purchase_tag +#: model:ir.model.fields,field_description:purchase_tag.field_purchase_tag__create_date +msgid "Created on" +msgstr "Creado el" + +#. module: purchase_tag +#: model:ir.model.fields,field_description:purchase_tag.field_purchase_tag__display_name +msgid "Display Name" +msgstr "Mostrar Nombre" + +#. module: purchase_tag +#: model:ir.model.fields,field_description:purchase_tag.field_purchase_tag__id +msgid "ID" +msgstr "ID (identificación)" + +#. module: purchase_tag +#: model:ir.model.fields,field_description:purchase_tag.field_purchase_tag____last_update +msgid "Last Modified on" +msgstr "Última Modificación el" + +#. module: purchase_tag +#: model:ir.model.fields,field_description:purchase_tag.field_purchase_tag__write_uid +msgid "Last Updated by" +msgstr "Actualizado por última vez por" + +#. module: purchase_tag +#: model:ir.model.fields,field_description:purchase_tag.field_purchase_tag__write_date +msgid "Last Updated on" +msgstr "Última Actualización el" + +#. module: purchase_tag +#: model:ir.model,name:purchase_tag.model_purchase_order +msgid "Purchase Order" +msgstr "Orden de compra" + +#. module: purchase_tag +#: model:ir.model,name:purchase_tag.model_purchase_tag +msgid "Purchase Tag" +msgstr "Etiqueta de compra" + +#. module: purchase_tag +#: model:ir.model.fields,field_description:purchase_tag.field_purchase_tag__name +msgid "Tag Name" +msgstr "Nombre de etiqueta" + +#. module: purchase_tag +#: model:ir.model.constraint,message:purchase_tag.constraint_purchase_tag_tag_name_uniq +msgid "Tag name already exists !" +msgstr "¡El nombre de etiqueta ya existe!" + +#. module: purchase_tag +#: model:ir.actions.act_window,name:purchase_tag.purchase_tag_action +#: model:ir.model.fields,field_description:purchase_tag.field_purchase_order__tag_ids +#: model:ir.ui.menu,name:purchase_tag.menu_purchase_tag_config +#: model_terms:ir.ui.view,arch_db:purchase_tag.purchase_tag_view_form +msgid "Tags" +msgstr "Etiquetas" diff --git a/purchase_tag/i18n/it.po b/purchase_tag/i18n/it.po new file mode 100644 index 00000000000..110a7fb4637 --- /dev/null +++ b/purchase_tag/i18n/it.po @@ -0,0 +1,90 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * purchase_tag +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-12-22 14: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: purchase_tag +#: model:ir.model.fields,field_description:purchase_tag.field_purchase_tag__color +msgid "Color" +msgstr "Colore" + +#. module: purchase_tag +#: model_terms:ir.actions.act_window,help:purchase_tag.purchase_tag_action +msgid "Create new tags for your purchase orders" +msgstr "Crea nuove etichette per gli ordini di acquisto" + +#. module: purchase_tag +#: model:ir.model.fields,field_description:purchase_tag.field_purchase_tag__create_uid +msgid "Created by" +msgstr "Creato da" + +#. module: purchase_tag +#: model:ir.model.fields,field_description:purchase_tag.field_purchase_tag__create_date +msgid "Created on" +msgstr "Creato il" + +#. module: purchase_tag +#: model:ir.model.fields,field_description:purchase_tag.field_purchase_tag__display_name +msgid "Display Name" +msgstr "Nome visualizzato" + +#. module: purchase_tag +#: model:ir.model.fields,field_description:purchase_tag.field_purchase_tag__id +msgid "ID" +msgstr "ID" + +#. module: purchase_tag +#: model:ir.model.fields,field_description:purchase_tag.field_purchase_tag____last_update +msgid "Last Modified on" +msgstr "Ultima modifica il" + +#. module: purchase_tag +#: model:ir.model.fields,field_description:purchase_tag.field_purchase_tag__write_uid +msgid "Last Updated by" +msgstr "Ultimo aggiornamento di" + +#. module: purchase_tag +#: model:ir.model.fields,field_description:purchase_tag.field_purchase_tag__write_date +msgid "Last Updated on" +msgstr "Ultimo aggiornamento il" + +#. module: purchase_tag +#: model:ir.model,name:purchase_tag.model_purchase_order +msgid "Purchase Order" +msgstr "Ordine di acquisto" + +#. module: purchase_tag +#: model:ir.model,name:purchase_tag.model_purchase_tag +msgid "Purchase Tag" +msgstr "Etichetta acquisti" + +#. module: purchase_tag +#: model:ir.model.fields,field_description:purchase_tag.field_purchase_tag__name +msgid "Tag Name" +msgstr "Nome etichetta" + +#. module: purchase_tag +#: model:ir.model.constraint,message:purchase_tag.constraint_purchase_tag_tag_name_uniq +msgid "Tag name already exists !" +msgstr "Il nome etichetta esiste già!" + +#. module: purchase_tag +#: model:ir.actions.act_window,name:purchase_tag.purchase_tag_action +#: model:ir.model.fields,field_description:purchase_tag.field_purchase_order__tag_ids +#: model:ir.ui.menu,name:purchase_tag.menu_purchase_tag_config +#: model_terms:ir.ui.view,arch_db:purchase_tag.purchase_tag_view_form +msgid "Tags" +msgstr "Etichette" diff --git a/purchase_tag/i18n/pt_BR.po b/purchase_tag/i18n/pt_BR.po new file mode 100644 index 00000000000..75e78643895 --- /dev/null +++ b/purchase_tag/i18n/pt_BR.po @@ -0,0 +1,90 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * purchase_tag +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-10-29 08:31+0000\n" +"Last-Translator: Adriano Prado \n" +"Language-Team: none\n" +"Language: pt_BR\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: purchase_tag +#: model:ir.model.fields,field_description:purchase_tag.field_purchase_tag__color +msgid "Color" +msgstr "Cor" + +#. module: purchase_tag +#: model_terms:ir.actions.act_window,help:purchase_tag.purchase_tag_action +msgid "Create new tags for your purchase orders" +msgstr "Crie novos marcadores para seus pedidos de compra" + +#. module: purchase_tag +#: model:ir.model.fields,field_description:purchase_tag.field_purchase_tag__create_uid +msgid "Created by" +msgstr "Criado por" + +#. module: purchase_tag +#: model:ir.model.fields,field_description:purchase_tag.field_purchase_tag__create_date +msgid "Created on" +msgstr "Criado em" + +#. module: purchase_tag +#: model:ir.model.fields,field_description:purchase_tag.field_purchase_tag__display_name +msgid "Display Name" +msgstr "Nome Exibição" + +#. module: purchase_tag +#: model:ir.model.fields,field_description:purchase_tag.field_purchase_tag__id +msgid "ID" +msgstr "ID" + +#. module: purchase_tag +#: model:ir.model.fields,field_description:purchase_tag.field_purchase_tag____last_update +msgid "Last Modified on" +msgstr "Última Modificação em" + +#. module: purchase_tag +#: model:ir.model.fields,field_description:purchase_tag.field_purchase_tag__write_uid +msgid "Last Updated by" +msgstr "Última Atualização por" + +#. module: purchase_tag +#: model:ir.model.fields,field_description:purchase_tag.field_purchase_tag__write_date +msgid "Last Updated on" +msgstr "Última Atualização em" + +#. module: purchase_tag +#: model:ir.model,name:purchase_tag.model_purchase_order +msgid "Purchase Order" +msgstr "Pedido de Compra" + +#. module: purchase_tag +#: model:ir.model,name:purchase_tag.model_purchase_tag +msgid "Purchase Tag" +msgstr "Marcador Compra" + +#. module: purchase_tag +#: model:ir.model.fields,field_description:purchase_tag.field_purchase_tag__name +msgid "Tag Name" +msgstr "Nome do Marcador" + +#. module: purchase_tag +#: model:ir.model.constraint,message:purchase_tag.constraint_purchase_tag_tag_name_uniq +msgid "Tag name already exists !" +msgstr "Marcador já Existe!" + +#. module: purchase_tag +#: model:ir.actions.act_window,name:purchase_tag.purchase_tag_action +#: model:ir.model.fields,field_description:purchase_tag.field_purchase_order__tag_ids +#: model:ir.ui.menu,name:purchase_tag.menu_purchase_tag_config +#: model_terms:ir.ui.view,arch_db:purchase_tag.purchase_tag_view_form +msgid "Tags" +msgstr "Marcadores" diff --git a/purchase_tag/i18n/purchase_tag.pot b/purchase_tag/i18n/purchase_tag.pot new file mode 100644 index 00000000000..c8e90d6ef98 --- /dev/null +++ b/purchase_tag/i18n/purchase_tag.pot @@ -0,0 +1,87 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * purchase_tag +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.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: purchase_tag +#: model:ir.model.fields,field_description:purchase_tag.field_purchase_tag__color +msgid "Color" +msgstr "" + +#. module: purchase_tag +#: model_terms:ir.actions.act_window,help:purchase_tag.purchase_tag_action +msgid "Create new tags for your purchase orders" +msgstr "" + +#. module: purchase_tag +#: model:ir.model.fields,field_description:purchase_tag.field_purchase_tag__create_uid +msgid "Created by" +msgstr "" + +#. module: purchase_tag +#: model:ir.model.fields,field_description:purchase_tag.field_purchase_tag__create_date +msgid "Created on" +msgstr "" + +#. module: purchase_tag +#: model:ir.model.fields,field_description:purchase_tag.field_purchase_tag__display_name +msgid "Display Name" +msgstr "" + +#. module: purchase_tag +#: model:ir.model.fields,field_description:purchase_tag.field_purchase_tag__id +msgid "ID" +msgstr "" + +#. module: purchase_tag +#: model:ir.model.fields,field_description:purchase_tag.field_purchase_tag____last_update +msgid "Last Modified on" +msgstr "" + +#. module: purchase_tag +#: model:ir.model.fields,field_description:purchase_tag.field_purchase_tag__write_uid +msgid "Last Updated by" +msgstr "" + +#. module: purchase_tag +#: model:ir.model.fields,field_description:purchase_tag.field_purchase_tag__write_date +msgid "Last Updated on" +msgstr "" + +#. module: purchase_tag +#: model:ir.model,name:purchase_tag.model_purchase_order +msgid "Purchase Order" +msgstr "" + +#. module: purchase_tag +#: model:ir.model,name:purchase_tag.model_purchase_tag +msgid "Purchase Tag" +msgstr "" + +#. module: purchase_tag +#: model:ir.model.fields,field_description:purchase_tag.field_purchase_tag__name +msgid "Tag Name" +msgstr "" + +#. module: purchase_tag +#: model:ir.model.constraint,message:purchase_tag.constraint_purchase_tag_tag_name_uniq +msgid "Tag name already exists !" +msgstr "" + +#. module: purchase_tag +#: model:ir.actions.act_window,name:purchase_tag.purchase_tag_action +#: model:ir.model.fields,field_description:purchase_tag.field_purchase_order__tag_ids +#: model:ir.ui.menu,name:purchase_tag.menu_purchase_tag_config +#: model_terms:ir.ui.view,arch_db:purchase_tag.purchase_tag_view_form +msgid "Tags" +msgstr "" diff --git a/purchase_tag/models/__init__.py b/purchase_tag/models/__init__.py new file mode 100644 index 00000000000..d54d894c559 --- /dev/null +++ b/purchase_tag/models/__init__.py @@ -0,0 +1,2 @@ +from . import purchase_tag +from . import purchase_order diff --git a/purchase_tag/models/purchase_order.py b/purchase_tag/models/purchase_order.py new file mode 100644 index 00000000000..5267d137cc4 --- /dev/null +++ b/purchase_tag/models/purchase_order.py @@ -0,0 +1,17 @@ +# Copyright 2022 ForgeFlow S.L. +# (http://www.forgeflow.com) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from odoo import fields, models + + +class PurchaseOrder(models.Model): + _inherit = "purchase.order" + + tag_ids = fields.Many2many( + comodel_name="purchase.tag", + relation="purchase_order_tag_rel", + column1="purchase_order_id", + column2="tag_id", + string="Tags", + ) diff --git a/purchase_tag/models/purchase_tag.py b/purchase_tag/models/purchase_tag.py new file mode 100644 index 00000000000..04f04867c92 --- /dev/null +++ b/purchase_tag/models/purchase_tag.py @@ -0,0 +1,22 @@ +# Copyright 2022 ForgeFlow S.L. +# (http://www.forgeflow.com) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from random import randint + +from odoo import fields, models + + +class PurchaseTag(models.Model): + _name = "purchase.tag" + _description = "Purchase Tag" + + def _get_default_color(self): + return randint(1, 11) + + name = fields.Char("Tag Name", required=True, translate=True) + color = fields.Integer(default=_get_default_color) + + _sql_constraints = [ + ("tag_name_uniq", "unique (name)", "Tag name already exists !"), + ] diff --git a/purchase_tag/pyproject.toml b/purchase_tag/pyproject.toml new file mode 100644 index 00000000000..4231d0cccb3 --- /dev/null +++ b/purchase_tag/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/purchase_tag/readme/CONTRIBUTORS.md b/purchase_tag/readme/CONTRIBUTORS.md new file mode 100644 index 00000000000..88b3ed521e7 --- /dev/null +++ b/purchase_tag/readme/CONTRIBUTORS.md @@ -0,0 +1 @@ +- Jasmin Solanki \<\> diff --git a/purchase_tag/readme/DESCRIPTION.md b/purchase_tag/readme/DESCRIPTION.md new file mode 100644 index 00000000000..feb507c6000 --- /dev/null +++ b/purchase_tag/readme/DESCRIPTION.md @@ -0,0 +1 @@ +This module allows to add multiple tags to purchase orders diff --git a/purchase_tag/readme/USAGE.md b/purchase_tag/readme/USAGE.md new file mode 100644 index 00000000000..7e54d63369c --- /dev/null +++ b/purchase_tag/readme/USAGE.md @@ -0,0 +1 @@ +To use this module, you need to go to Purchase Orders and select tags. diff --git a/purchase_tag/security/ir.model.access.csv b/purchase_tag/security/ir.model.access.csv new file mode 100644 index 00000000000..8ad7fcd8e8a --- /dev/null +++ b/purchase_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_purchase_tag,purchase_tag,model_purchase_tag,base.group_user,1,0,0,0 +access_purchase_tag_manager,purchase_tag_manager,model_purchase_tag,purchase.group_purchase_manager,1,1,1,1 diff --git a/purchase_tag/static/description/icon.png b/purchase_tag/static/description/icon.png new file mode 100644 index 00000000000..3a0328b516c Binary files /dev/null and b/purchase_tag/static/description/icon.png differ diff --git a/purchase_tag/static/description/index.html b/purchase_tag/static/description/index.html new file mode 100644 index 00000000000..49a08e8210c --- /dev/null +++ b/purchase_tag/static/description/index.html @@ -0,0 +1,426 @@ + + + + + + +Purchase Tags + + + +
+

Purchase Tags

+ + +

Beta License: AGPL-3 OCA/purchase-workflow Translate me on Weblate Try me on Runboat

+

This module allows to add multiple tags to purchase orders

+

Table of contents

+ +
+

Usage

+

To use this module, you need to go to Purchase Orders and select tags.

+
+
+

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

+ +
+
+

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.

+

This module is part of the OCA/purchase-workflow project on GitHub.

+

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

+
+
+
+ + diff --git a/purchase_tag/views/purchase_tag_view.xml b/purchase_tag/views/purchase_tag_view.xml new file mode 100644 index 00000000000..dfcc7a81112 --- /dev/null +++ b/purchase_tag/views/purchase_tag_view.xml @@ -0,0 +1,59 @@ + + + + + + + purchase.tag.view.form + purchase.tag + +
+ +
+
+
+

+ +

+
+ + + + + +
+
+
+
+ + + purchase.tag.view.tree + purchase.tag + + + + + + + + + + Tags + purchase.tag + + +

+ Create new tags for your purchase orders +

+
+
+ + +
diff --git a/purchase_tag/views/purchase_view.xml b/purchase_tag/views/purchase_view.xml new file mode 100644 index 00000000000..ab6d2ebde18 --- /dev/null +++ b/purchase_tag/views/purchase_view.xml @@ -0,0 +1,53 @@ + + + + + + + purchase.order.form + purchase.order + + + + + + + + + + purchase.order.tree + purchase.order + + + + + + + + + + purchase.order.tree + purchase.order + + + + + + + + +