-
Notifications
You must be signed in to change notification settings - Fork 3
[15.0][6429][ADD] product_tag #262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
AungKoKoLin1997
wants to merge
7
commits into
15.0
Choose a base branch
from
15.0-add-product_tag
base: 15.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
45ebfa6
[ADD] product_tag
AungKoKoLin1997 43375fa
fixup
AungKoKoLin1997 1ffd7ae
fixup
AungKoKoLin1997 cf8a885
fixup
AungKoKoLin1997 32df2a7
add setup
AungKoKoLin1997 2b0dda3
upd copyright and readme
AungKoKoLin1997 626fdb1
add translation
smorita7749 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 <https://github.com/qrtl/mi7-custom/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 <https://github.com/qrtl/mi7-custom/issues/new?body=module:%20product_tag%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. | ||
|
|
||
| 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 <https://github.com/qrtl/mi7-custom/tree/15.0/product_tag>`_ project on GitHub. | ||
|
|
||
| You are welcome to contribute. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| from . import models |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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, | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 "カテゴリ名がすでに存在します!" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| from . import product_tag | ||
| from . import product_template |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 !"), | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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" | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| - Go to *Sales → Configuration → Product Tags*. | ||
| - Create a tag by setting its *Name* and *Color*. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| * On a product template, set **Product Tags** to apply tags to all of its | ||
| variants. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!