Skip to content

Commit

Permalink
[MOV] product_template_tags_code: product_template_tags_code becomes …
Browse files Browse the repository at this point in the history
…product_tags_code
  • Loading branch information
Kimkhoi3010 committed Dec 23, 2024
1 parent 6f1cb9a commit 2743d8d
Show file tree
Hide file tree
Showing 19 changed files with 30 additions and 30 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
=====================
Product Template Tags
=====================
=================
Product Tags Code
=================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Expand All @@ -17,10 +17,10 @@ Product Template Tags
: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_template_tags_code
:target: https://github.com/OCA/product-attribute/tree/18.0/product_tags_code
: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_template_tags_code
:target: https://translation.odoo-community.org/projects/product-attribute-18-0/product-attribute-18-0-product_tags_code
: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
Expand Down Expand Up @@ -49,7 +49,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/product-attribute/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/OCA/product-attribute/issues/new?body=module:%20product_template_tags_code%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/product-attribute/issues/new?body=module:%20product_tags_code%0Aversion:%2018.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.

Expand Down Expand Up @@ -94,6 +94,6 @@ 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 <https://github.com/OCA/product-attribute/tree/18.0/product_template_tags_code>`_ project on GitHub.
This module is part of the `OCA/product-attribute <https://github.com/OCA/product-attribute/tree/18.0/product_tags_code>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Product Template Tags",
"name": "Product Tags Code",
"summary": "This addon allow to add code on products tags",
"version": "18.0.1.0.0",
"license": "AGPL-3",
"author": "Camptocamp SA, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/product-attribute",
"depends": ["product"],
"data": ["views/product_template_tag.xml"],
"data": ["views/product_tag_views.xml"],
}
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions product_tags_code/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import product_tag
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from odoo import api, fields, models


class ProductTemplateTag(models.Model):
class ProductTag(models.Model):
_inherit = "product.tag"

code = fields.Char(
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
<title>Product Template Tags</title>
<title>Product Tags Code</title>
<style type="text/css">

/*
Expand Down Expand Up @@ -360,16 +360,16 @@
</style>
</head>
<body>
<div class="document" id="product-template-tags">
<h1 class="title">Product Template Tags</h1>
<div class="document" id="product-tags-code">
<h1 class="title">Product Tags Code</h1>

<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:9f262329aa57825a999684e47eb384f4421d82420f6de9a54c2e46b8069517e9
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/product-attribute/tree/18.0/product_template_tags_code"><img alt="OCA/product-attribute" src="https://img.shields.io/badge/github-OCA%2Fproduct--attribute-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/product-attribute-18-0/product-attribute-18-0-product_template_tags_code"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/product-attribute&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/product-attribute/tree/18.0/product_tags_code"><img alt="OCA/product-attribute" src="https://img.shields.io/badge/github-OCA%2Fproduct--attribute-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/product-attribute-18-0/product-attribute-18-0-product_tags_code"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/product-attribute&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>Allows to reference tag records trough a unique code.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
Expand Down Expand Up @@ -398,7 +398,7 @@ <h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/product-attribute/issues">GitHub Issues</a>.
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
<a class="reference external" href="https://github.com/OCA/product-attribute/issues/new?body=module:%20product_template_tags_code%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/product-attribute/issues/new?body=module:%20product_tags_code%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
Expand Down Expand Up @@ -438,7 +438,7 @@ <h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
<p>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.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/product-attribute/tree/18.0/product_template_tags_code">OCA/product-attribute</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/product-attribute/tree/18.0/product_tags_code">OCA/product-attribute</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2020 Camptocamp
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import test_product_template_tags
from . import test_product_tags_code
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,36 @@
from odoo.addons.base.tests.common import BaseCommon


class TestProductTemplateTag(BaseCommon):
class TestProductTagsCode(BaseCommon):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.product_tmpl = cls.env["product.template"].create({"name": "Test Product"})

def test_product_template_tag(self):
product_tmpl_tag = self.env["product.tag"].create(
def test_product_tags_code(self):
product_tag = self.env["product.tag"].create(
{
"name": "Test Tag",
"product_template_ids": [(6, 0, [self.product_tmpl.id])],
}
)
self.assertEqual(product_tmpl_tag.code, "test-tag")
self.assertEqual(product_tag.code, "test-tag")

def test_product_template_tag_writable(self):
product_tmpl_tag = self.env["product.tag"].create(
def test_product_tags_code_writable(self):
product_tag = self.env["product.tag"].create(
{
"name": "Test Tag",
"code": "foo tag !!",
"product_template_ids": [(6, 0, [self.product_tmpl.id])],
}
)
self.assertEqual(product_tmpl_tag.code, "foo-tag")
product_tmpl_tag.write({"code": "test tag writable"})
self.assertEqual(product_tmpl_tag.code, "test-tag-writable")
product_tmpl_tag.write({"name": "test tag name 2"})
self.assertEqual(product_tmpl_tag.code, "test-tag-name-2")
self.assertEqual(product_tag.code, "foo-tag")
product_tag.write({"code": "test tag writable"})
self.assertEqual(product_tag.code, "test-tag-writable")
product_tag.write({"name": "test tag name 2"})
self.assertEqual(product_tag.code, "test-tag-name-2")

def test_product_template_multi_tags(self):
def test_product_multi_tags(self):
prods_data = []
for x in range(3):
prods_data.append(
Expand Down
1 change: 0 additions & 1 deletion product_template_tags_code/models/__init__.py

This file was deleted.

0 comments on commit 2743d8d

Please sign in to comment.