Skip to content

Commit

Permalink
[MIG] product_brand_tag: Migration to 18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
HeliconiaSolutions committed Feb 11, 2025
1 parent 467b776 commit aebe902
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 10 deletions.
3 changes: 3 additions & 0 deletions product_brand_tag/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ Contributors
------------

- Simone Orsi <[email protected]>
- `Heliconia Solutions Pvt. Ltd. <https://www.heliconia.io>`__

- Bhavesh Heliconia

Maintainers
-----------
Expand Down
2 changes: 1 addition & 1 deletion product_brand_tag/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"name": "Product brand tags",
"summary": "Add tags to product brand",
"version": "16.0.1.0.0",
"version": "18.0.1.0.0",
"author": "Camptocamp, Odoo Community Association (OCA)",
"license": "AGPL-3",
"category": "Product",
Expand Down
6 changes: 2 additions & 4 deletions product_brand_tag/models/product_brand_tag_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

from odoo import api, fields, models

from odoo.addons.http_routing.models.ir_http import slugify


class ProductBrandTag(models.AbstractModel):
_name = "product.brand.tag.mixin"
Expand Down Expand Up @@ -42,12 +40,12 @@ class ProductBrandTag(models.AbstractModel):
@api.depends("name")
def _compute_code(self):
for rec in self:
rec.code = slugify(rec.name)
rec.code = self.env["ir.http"]._slugify(rec.name or "")

def _inverse_code(self):
for rec in self:
# Make sure is always normalized
rec.code = slugify(rec.code)
rec.code = self.env["ir.http"]._slugify(rec.code)

@api.depends("product_brand_ids")
def _compute_brands_count(self):
Expand Down
2 changes: 2 additions & 0 deletions product_brand_tag/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
- Simone Orsi \<<[email protected]>\>
- [Heliconia Solutions Pvt. Ltd.](https://www.heliconia.io)
- Bhavesh Heliconia
2 changes: 1 addition & 1 deletion product_brand_tag/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_product_brand_tag_product_manager,product.brand.tag,model_product_brand_tag,base.group_partner_manager,1,1,1,1
access_product_brand_tag_public,product.brand.tag.public,model_product_brand_tag,,1,0,0,0
access_product_brand_tag_public,product.brand.tag.public,model_product_brand_tag,base.group_user,1,0,0,0
4 changes: 4 additions & 0 deletions product_brand_tag/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,10 @@ <h2><a class="toc-backref" href="#toc-entry-3">Authors</a></h2>
<h2><a class="toc-backref" href="#toc-entry-4">Contributors</a></h2>
<ul class="simple">
<li>Simone Orsi &lt;<a class="reference external" href="mailto:simone.orsi&#64;camptocamp.com">simone.orsi&#64;camptocamp.com</a>&gt;</li>
<li><a class="reference external" href="https://www.heliconia.io">Heliconia Solutions Pvt. Ltd.</a><ul>
<li>Bhavesh Heliconia</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="maintainers">
Expand Down
3 changes: 2 additions & 1 deletion product_brand_tag/tests/test_product_brand.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

from psycopg2 import IntegrityError

from odoo import Command
from odoo.tools import mute_logger

from odoo.addons.product_brand.tests.common import CommonCase
Expand All @@ -19,7 +20,7 @@ def setUpClass(cls):
{
"name": "Test Tag",
"product_brand_ids": [
(6, 0, [cls.product_brand.id, cls.product_brand2.id])
Command.set([cls.product_brand.id, cls.product_brand2.id])
],
}
)
Expand Down
6 changes: 3 additions & 3 deletions product_brand_tag/views/product_brand_tag_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
<field name="name">product.brand.tag.tree</field>
<field name="model">product.brand.tag</field>
<field name="arch" type="xml">
<tree editable="top">
<list editable="top">
<field name="name" />
<field name="code" />
<field name="product_brand_ids" widget="many2many_tags" />
<field name="company_id" groups="base.group_multi_company" />
</tree>
</list>
</field>
</record>

Expand Down Expand Up @@ -43,7 +43,7 @@
<record model="ir.actions.act_window" id="action_product_brand_tags">
<field name="name">Brand tags</field>
<field name="res_model">product.brand.tag</field>
<field name="view_mode">tree</field>
<field name="view_mode">list</field>
</record>

<menuitem
Expand Down

0 comments on commit aebe902

Please sign in to comment.