diff --git a/product_product_template_link/README.rst b/product_product_template_link/README.rst new file mode 100644 index 00000000000..a9889f3477b --- /dev/null +++ b/product_product_template_link/README.rst @@ -0,0 +1,96 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + +===================== +Product Template Link +===================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:27be7b4256992f195687c59b8c2436091b435d5d65275be58e7430006135da73 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/license-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%2Fproduct--attribute-lightgray.png?logo=github + :target: https://github.com/OCA/product-attribute/tree/18.0/product_product_template_link + :alt: OCA/product-attribute +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/product-attribute-18-0/product-attribute-18-0-product_product_template_link + :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/product-attribute&target_branch=18.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module adds a button in the product form to view the product +template. + +|image| + +.. |image| image:: https://raw.githubusercontent.com/OCA/product-attribute/18.0/product_product_template_link/static/img/template_navigation.gif + +**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 +------- + +* Tecnativa + +Contributors +------------ + +- `Tecnativa `__: + + - Alexandre Díaz + - Pedro M. Baeza + +- `Cetmix `__: + + - Dessan Hemrayev + +- PyTech SRL + +- aravindh admin + +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/product-attribute `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/product_product_template_link/__init__.py b/product_product_template_link/__init__.py new file mode 100644 index 00000000000..4b76c7b2d5c --- /dev/null +++ b/product_product_template_link/__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/product_product_template_link/__manifest__.py b/product_product_template_link/__manifest__.py new file mode 100644 index 00000000000..10d8fd022da --- /dev/null +++ b/product_product_template_link/__manifest__.py @@ -0,0 +1,15 @@ +# Copyright 2019 Alexandre Díaz - Tecnativa +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). +{ + "name": "Product Template Link", + "summary": "Adds a button in product to view the template", + "author": "Tecnativa, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/product-attribute", + "category": "Product", + "version": "19.0.1.0.0", + "license": "AGPL-3", + "depends": ["product"], + "data": ["views/product_product_views.xml"], + "installable": True, + "application": False, +} diff --git a/product_product_template_link/i18n/ca.po b/product_product_template_link/i18n/ca.po new file mode 100644 index 00000000000..13de12f1652 --- /dev/null +++ b/product_product_template_link/i18n/ca.po @@ -0,0 +1,34 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_product_template_link +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 13.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2021-02-25 12:45+0000\n" +"Last-Translator: claudiagn \n" +"Language-Team: none\n" +"Language: ca\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.3.2\n" + +#. module: product_product_template_link +#: model_terms:ir.ui.view,arch_db:product_product_template_link.product_template_form_view +msgid "" +"\n" +" View Template\n" +" " +msgstr "" + +#. module: product_product_template_link +#: model:ir.model,name:product_product_template_link.model_product_product +#, fuzzy +msgid "Product Variant" +msgstr "Producte" + +#~ msgid "View Template" +#~ msgstr "Veure plantilla" diff --git a/product_product_template_link/i18n/es.po b/product_product_template_link/i18n/es.po new file mode 100644 index 00000000000..feb7c2e396b --- /dev/null +++ b/product_product_template_link/i18n/es.po @@ -0,0 +1,36 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_product_template_link +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-12-29 11:34+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: product_product_template_link +#: model_terms:ir.ui.view,arch_db:product_product_template_link.product_template_form_view +msgid "" +"\n" +" View Template\n" +" " +msgstr "" +"\n" +" Visualizar Plantilla\n" +" " + +#. module: product_product_template_link +#: model:ir.model,name:product_product_template_link.model_product_product +msgid "Product Variant" +msgstr "Variante del Producto" + +#~ msgid "View Template" +#~ msgstr "Ver plantilla" diff --git a/product_product_template_link/i18n/it.po b/product_product_template_link/i18n/it.po new file mode 100644 index 00000000000..be82c43fd13 --- /dev/null +++ b/product_product_template_link/i18n/it.po @@ -0,0 +1,45 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_product_template_link +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-12-24 17:37+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: product_product_template_link +#: model_terms:ir.ui.view,arch_db:product_product_template_link.product_template_form_view +msgid "" +"\n" +" View Template\n" +" " +msgstr "" +"\n" +" Visualizza modello\n" +" " + +#. module: product_product_template_link +#: model:ir.model,name:product_product_template_link.model_product_product +msgid "Product Variant" +msgstr "Variante prodotto" + +#~ msgid "Display Name" +#~ msgstr "Nome visualizzato" + +#~ msgid "ID" +#~ msgstr "ID" + +#~ msgid "Last Modified on" +#~ msgstr "Ultima modifica il" + +#~ msgid "View Template" +#~ msgstr "Visualizza modello" diff --git a/product_product_template_link/i18n/product_product_template_link.pot b/product_product_template_link/i18n/product_product_template_link.pot new file mode 100644 index 00000000000..21dbfe727c4 --- /dev/null +++ b/product_product_template_link/i18n/product_product_template_link.pot @@ -0,0 +1,27 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_product_template_link +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.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: product_product_template_link +#: model_terms:ir.ui.view,arch_db:product_product_template_link.product_template_form_view +msgid "" +"\n" +" View Template\n" +" " +msgstr "" + +#. module: product_product_template_link +#: model:ir.model,name:product_product_template_link.model_product_product +msgid "Product Variant" +msgstr "" diff --git a/product_product_template_link/i18n/product_product_template_navigation.pot b/product_product_template_link/i18n/product_product_template_navigation.pot new file mode 100644 index 00000000000..7cbdce217ee --- /dev/null +++ b/product_product_template_link/i18n/product_product_template_navigation.pot @@ -0,0 +1,39 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_product_template_link +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.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: product_product_template_link +#: model:ir.model.fields,field_description:product_product_template_link.field_product_product__display_name +msgid "Display Name" +msgstr "" + +#. module: product_product_template_link +#: model:ir.model.fields,field_description:product_product_template_link.field_product_product__id +msgid "ID" +msgstr "" + +#. module: product_product_template_link +#: model:ir.model.fields,field_description:product_product_template_link.field_product_product____last_update +msgid "Last Modified on" +msgstr "" + +#. module: product_product_template_link +#: model:ir.model,name:product_product_template_link.model_product_product +msgid "Product" +msgstr "" + +#. module: product_product_template_link +#: model_terms:ir.ui.view,arch_db:product_product_template_link.product_template_form_view +msgid "View Template" +msgstr "" diff --git a/product_product_template_link/models/__init__.py b/product_product_template_link/models/__init__.py new file mode 100644 index 00000000000..f464a9b8a37 --- /dev/null +++ b/product_product_template_link/models/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from . import product_product diff --git a/product_product_template_link/models/product_product.py b/product_product_template_link/models/product_product.py new file mode 100644 index 00000000000..e308a1cfae9 --- /dev/null +++ b/product_product_template_link/models/product_product.py @@ -0,0 +1,17 @@ +# Copyright 2019 Alexandre Díaz - Tecnativa +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from odoo import models + + +class ProductProduct(models.Model): + _inherit = "product.product" + + def action_open_product_template(self): + self.ensure_one() + return { + "type": "ir.actions.act_window", + "res_model": "product.template", + "res_id": self.product_tmpl_id.id, + "views": [[False, "form"]], + } diff --git a/product_product_template_link/pyproject.toml b/product_product_template_link/pyproject.toml new file mode 100644 index 00000000000..4231d0cccb3 --- /dev/null +++ b/product_product_template_link/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/product_product_template_link/readme/CONTRIBUTORS.md b/product_product_template_link/readme/CONTRIBUTORS.md new file mode 100644 index 00000000000..974c4951471 --- /dev/null +++ b/product_product_template_link/readme/CONTRIBUTORS.md @@ -0,0 +1,6 @@ +- [Tecnativa](https://www.tecnativa.com): + - Alexandre Díaz + - Pedro M. Baeza +- [Cetmix](https://www.cetmix.com): + - Dessan Hemrayev +- PyTech SRL \<\> diff --git a/product_product_template_link/readme/DESCRIPTION.md b/product_product_template_link/readme/DESCRIPTION.md new file mode 100644 index 00000000000..24513d42172 --- /dev/null +++ b/product_product_template_link/readme/DESCRIPTION.md @@ -0,0 +1,4 @@ +This module adds a button in the product form to view the product +template. + +![image](../static/img/template_navigation.gif) diff --git a/product_product_template_link/static/description/icon.png b/product_product_template_link/static/description/icon.png new file mode 100644 index 00000000000..3a0328b516c Binary files /dev/null and b/product_product_template_link/static/description/icon.png differ diff --git a/product_product_template_link/static/description/index.html b/product_product_template_link/static/description/index.html new file mode 100644 index 00000000000..2bdc33473c9 --- /dev/null +++ b/product_product_template_link/static/description/index.html @@ -0,0 +1,440 @@ + + + + + +README.rst + + + +
+ + + +Odoo Community Association + + +
+ + diff --git a/product_product_template_link/static/img/template_navigation.gif b/product_product_template_link/static/img/template_navigation.gif new file mode 100644 index 00000000000..93a033c81a6 Binary files /dev/null and b/product_product_template_link/static/img/template_navigation.gif differ diff --git a/product_product_template_link/tests/__init__.py b/product_product_template_link/tests/__init__.py new file mode 100644 index 00000000000..69c8dc9f630 --- /dev/null +++ b/product_product_template_link/tests/__init__.py @@ -0,0 +1 @@ +from . import test_product_product_template_link diff --git a/product_product_template_link/tests/test_product_product_template_link.py b/product_product_template_link/tests/test_product_product_template_link.py new file mode 100644 index 00000000000..f795f77ee2c --- /dev/null +++ b/product_product_template_link/tests/test_product_product_template_link.py @@ -0,0 +1,19 @@ +from odoo.tests.common import TransactionCase + + +class TestCommon(TransactionCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + + cls.products = cls.env["product.product"].search([], limit=1) + + def test_action_open_product_template(self): + actual = { + "type": "ir.actions.act_window", + "res_model": "product.template", + "res_id": self.products.product_tmpl_id.id, + "views": [[False, "form"]], + } + expected = self.products.action_open_product_template() + self.assertDictEqual(expected, actual, msg=None) diff --git a/product_product_template_link/views/product_product_views.xml b/product_product_template_link/views/product_product_views.xml new file mode 100644 index 00000000000..0f0623742a0 --- /dev/null +++ b/product_product_template_link/views/product_product_views.xml @@ -0,0 +1,24 @@ + + + + product.product.normal.form + product.product + + + + + + +