diff --git a/product_tag/README.rst b/product_tag/README.rst new file mode 100644 index 00000000..ca8d1c9c --- /dev/null +++ b/product_tag/README.rst @@ -0,0 +1,77 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + +=========== +Product Tag +=========== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:632ef97cd594c9321308526f1c31204b66bf00c20afb8179ab5aadeeab82637c + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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-LGPL--3-blue.png + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-qrtl%2Fmi7--custom-lightgray.png?logo=github + :target: https://github.com/qrtl/mi7-custom/tree/15.0/product_tag + :alt: qrtl/mi7-custom + +|badge1| |badge2| |badge3| + +This module backports the ``product.tag`` model from Odoo 16, allowing +products to be classified with tags in Odoo 15. + +Unlike the original Odoo 16 design, the implementation has been +simplified: tags can only be assigned at the product template +(``product.template``) level, and not at the product variant +(``product.product``) level. + +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + +- Go to *Sales → Configuration → Product Tags*. +- Create a tag by setting its *Name* and *Color*. + +Usage +===== + +- On a product template, set **Product Tags** to apply tags to all of + its variants. + +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 +------- + +* Quartile + +Maintainers +----------- + +This module is part of the `qrtl/mi7-custom `_ project on GitHub. + +You are welcome to contribute. diff --git a/product_tag/__init__.py b/product_tag/__init__.py new file mode 100644 index 00000000..0650744f --- /dev/null +++ b/product_tag/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/product_tag/__manifest__.py b/product_tag/__manifest__.py new file mode 100644 index 00000000..d9c06f18 --- /dev/null +++ b/product_tag/__manifest__.py @@ -0,0 +1,19 @@ +# Copyright Odoo S.A. +# Copyright 2026 Quartile (https://www.quartile.co) +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). +{ + "name": "Product Tag", + "category": "Product", + "version": "15.0.1.0.0", + "author": "Quartile", + "website": "https://www.quartile.co", + "license": "LGPL-3", + "depends": ["sale"], + "data": [ + "security/ir.model.access.csv", + "views/product_tag_views.xml", + "views/product_template_views.xml", + "views/product_views.xml", + ], + "installable": True, +} diff --git a/product_tag/i18n/ja.po b/product_tag/i18n/ja.po new file mode 100644 index 00000000..425d4717 --- /dev/null +++ b/product_tag/i18n/ja.po @@ -0,0 +1,86 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_tag +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 15.0+e\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-06-04 08:42+0000\n" +"PO-Revision-Date: 2026-06-04 08:42+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: product_tag +#: model:ir.model.fields,field_description:product_tag.field_product_tag__color +msgid "Color" +msgstr "色" + +#. module: product_tag +#: model:ir.model.fields,field_description:product_tag.field_product_tag__create_uid +msgid "Created by" +msgstr "作成者" + +#. module: product_tag +#: model:ir.model.fields,field_description:product_tag.field_product_tag__create_date +msgid "Created on" +msgstr "作成日" + +#. module: product_tag +#: model:ir.model.fields,field_description:product_tag.field_product_tag__display_name +msgid "Display Name" +msgstr "表示名" + +#. module: product_tag +#: model:ir.model.fields,field_description:product_tag.field_product_tag__id +msgid "ID" +msgstr "ID" + +#. module: product_tag +#: model:ir.model.fields,field_description:product_tag.field_product_tag____last_update +msgid "Last Modified on" +msgstr "最終更新日" + +#. module: product_tag +#: model:ir.model.fields,field_description:product_tag.field_product_tag__write_uid +msgid "Last Updated by" +msgstr "最終更新者" + +#. module: product_tag +#: model:ir.model.fields,field_description:product_tag.field_product_tag__write_date +msgid "Last Updated on" +msgstr "最終更新日" + +#. module: product_tag +#: model:ir.model,name:product_tag.model_product_tag +#: model_terms:ir.ui.view,arch_db:product_tag.product_tag_form_view +msgid "Product Tag" +msgstr "製品カテゴリ" + +#. module: product_tag +#: model:ir.actions.act_window,name:product_tag.product_tag_action +#: model:ir.model.fields,field_description:product_tag.field_product_product__product_tag_ids +#: model:ir.model.fields,field_description:product_tag.field_product_template__product_tag_ids +#: model:ir.ui.menu,name:product_tag.product_tag_menu +msgid "Product Tags" +msgstr "製品カテゴリ" + +#. module: product_tag +#: model:ir.model,name:product_tag.model_product_template +#: model:ir.model.fields,field_description:product_tag.field_product_tag__product_template_ids +msgid "Product Template" +msgstr "プロダクトテンプレート" + +#. module: product_tag +#: model:ir.model.fields,field_description:product_tag.field_product_tag__name +msgid "Tag Name" +msgstr "カテゴリ名" + +#. module: product_tag +#: model:ir.model.constraint,message:product_tag.constraint_product_tag_name_uniq +msgid "Tag name already exists !" +msgstr "カテゴリ名がすでに存在します!" diff --git a/product_tag/models/__init__.py b/product_tag/models/__init__.py new file mode 100644 index 00000000..a898be3b --- /dev/null +++ b/product_tag/models/__init__.py @@ -0,0 +1,2 @@ +from . import product_tag +from . import product_template diff --git a/product_tag/models/product_tag.py b/product_tag/models/product_tag.py new file mode 100644 index 00000000..aebc2e70 --- /dev/null +++ b/product_tag/models/product_tag.py @@ -0,0 +1,25 @@ +# Copyright Odoo S.A. +# Copyright 2026 Quartile (https://www.quartile.co) +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). + +from random import randint + +from odoo import fields, models + + +class ProductTag(models.Model): + _name = "product.tag" + _description = "Product 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) + product_template_ids = fields.Many2many( + "product.template", "product_tag_product_template_rel" + ) + + _sql_constraints = [ + ("name_uniq", "unique (name)", "Tag name already exists !"), + ] diff --git a/product_tag/models/product_template.py b/product_tag/models/product_template.py new file mode 100644 index 00000000..c662029e --- /dev/null +++ b/product_tag/models/product_template.py @@ -0,0 +1,13 @@ +# Copyright Odoo S.A. +# Copyright 2026 Quartile (https://www.quartile.co) +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). + +from odoo import fields, models + + +class ProductTemplate(models.Model): + _inherit = "product.template" + + product_tag_ids = fields.Many2many( + "product.tag", "product_tag_product_template_rel", string="Product Tags" + ) diff --git a/product_tag/readme/CONFIGURE.md b/product_tag/readme/CONFIGURE.md new file mode 100644 index 00000000..49149fba --- /dev/null +++ b/product_tag/readme/CONFIGURE.md @@ -0,0 +1,2 @@ +- Go to *Sales → Configuration → Product Tags*. +- Create a tag by setting its *Name* and *Color*. diff --git a/product_tag/readme/DESCRIPTION.md b/product_tag/readme/DESCRIPTION.md new file mode 100644 index 00000000..b63ed6cd --- /dev/null +++ b/product_tag/readme/DESCRIPTION.md @@ -0,0 +1,6 @@ +This module backports the `product.tag` model from Odoo 16, allowing +products to be classified with tags in Odoo 15. + +Unlike the original Odoo 16 design, the implementation has been simplified: tags can +only be assigned at the product template (`product.template`) level, and not at the +product variant (`product.product`) level. diff --git a/product_tag/readme/USAGE.md b/product_tag/readme/USAGE.md new file mode 100644 index 00000000..08d2691f --- /dev/null +++ b/product_tag/readme/USAGE.md @@ -0,0 +1,2 @@ +* On a product template, set **Product Tags** to apply tags to all of its + variants. diff --git a/product_tag/security/ir.model.access.csv b/product_tag/security/ir.model.access.csv new file mode 100644 index 00000000..cf961d93 --- /dev/null +++ b/product_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_product_tag_user,product.tag.user,model_product_tag,base.group_user,1,0,0,0 +access_product_tag_manager,product.tag.manager,model_product_tag,base.group_system,1,1,1,1 diff --git a/product_tag/static/description/index.html b/product_tag/static/description/index.html new file mode 100644 index 00000000..1d75684f --- /dev/null +++ b/product_tag/static/description/index.html @@ -0,0 +1,436 @@ + + + + + +README.rst + + + +
+ + + +Odoo Community Association + +
+

Product Tag

+ +

Beta License: LGPL-3 qrtl/mi7-custom

+

This module backports the product.tag model from Odoo 16, allowing +products to be classified with tags in Odoo 15.

+

Unlike the original Odoo 16 design, the implementation has been +simplified: tags can only be assigned at the product template +(product.template) level, and not at the product variant +(product.product) level.

+

Table of contents

+ +
+

Configuration

+
    +
  • Go to Sales → Configuration → Product Tags.
  • +
  • Create a tag by setting its Name and Color.
  • +
+
+
+

Usage

+
    +
  • On a product template, set Product Tags to apply tags to all of +its variants.
  • +
+
+
+

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

+
    +
  • Quartile
  • +
+
+
+

Maintainers

+

This module is part of the qrtl/mi7-custom project on GitHub.

+

You are welcome to contribute.

+
+
+
+
+ + diff --git a/product_tag/views/product_tag_views.xml b/product_tag/views/product_tag_views.xml new file mode 100644 index 00000000..40df9b5c --- /dev/null +++ b/product_tag/views/product_tag_views.xml @@ -0,0 +1,49 @@ + + + + product.tag.form + product.tag + +
+ + + + + + + + + + + +
+
+
+ + product.tag.tree + product.tag + + + + + + + + + Product Tags + ir.actions.act_window + product.tag + tree,form + + +
diff --git a/product_tag/views/product_template_views.xml b/product_tag/views/product_template_views.xml new file mode 100644 index 00000000..209fcc4c --- /dev/null +++ b/product_tag/views/product_template_views.xml @@ -0,0 +1,32 @@ + + + + product.template.form + product.template + + + + + + + + + product.template.tree + product.template + + + + + + + + diff --git a/product_tag/views/product_views.xml b/product_tag/views/product_views.xml new file mode 100644 index 00000000..4568d33b --- /dev/null +++ b/product_tag/views/product_views.xml @@ -0,0 +1,18 @@ + + + + product.product.tree + product.product + + + + + + + + diff --git a/setup/product_tag/odoo/addons/product_tag b/setup/product_tag/odoo/addons/product_tag new file mode 120000 index 00000000..4c12bd50 --- /dev/null +++ b/setup/product_tag/odoo/addons/product_tag @@ -0,0 +1 @@ +../../../../product_tag \ No newline at end of file diff --git a/setup/product_tag/setup.py b/setup/product_tag/setup.py new file mode 100644 index 00000000..28c57bb6 --- /dev/null +++ b/setup/product_tag/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)