Skip to content

Commit

Permalink
[MIG] mrp_tag: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
aarribas-alquemy committed Sep 4, 2024
1 parent 0bd8539 commit 962854e
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
1 change: 1 addition & 0 deletions mrp_tag/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ Contributors
------------

- Jasmin Solanki <jasmin.solanki@forgeflow.com>
- Arturo Arribas <aarribas@alquemy.es>

Maintainers
-----------
Expand Down
2 changes: 1 addition & 1 deletion mrp_tag/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{
"name": "MRP Tags",
"summary": "Allows to add multiple tags to Manufacturing Orders",
"version": "16.0.1.1.0",
"version": "17.0.1.0.0",
"author": "ForgeFlow, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/manufacture",
"category": "Purchases",
Expand Down
19 changes: 8 additions & 11 deletions mrp_tag/models/mrp_tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,29 +26,26 @@ def _get_default_color(self):
("tag_name_uniq", "unique (name)", "Tag name already exists !"),
]

def name_get(self):
res = []
@api.depends("name", "parent_id")
def _compute_display_name(self):
for tag in self:
names = []
current = tag

Check warning on line 33 in mrp_tag/models/mrp_tag.py

View check run for this annotation

Codecov / codecov/patch

mrp_tag/models/mrp_tag.py#L32-L33

Added lines #L32 - L33 were not covered by tests
while current:
while current.name:
names.append(current.name)
current = current.parent_id
res.append((tag.id, " / ".join(reversed(names))))
return res
tag.display_name = " / ".join(reversed(names))

Check warning on line 37 in mrp_tag/models/mrp_tag.py

View check run for this annotation

Codecov / codecov/patch

mrp_tag/models/mrp_tag.py#L35-L37

Added lines #L35 - L37 were not covered by tests

@api.model
def _name_search(
self, name="", args=None, operator="ilike", limit=100, name_get_uid=None
):
def _name_search(self, name, domain=None, operator="ilike", limit=None, order=None):
if name:
args = [("name", operator, name.split(" / ")[-1])] + list(args or [])
domain = [("name", operator, name.split(" / ")[-1])] + list(domain or [])
return super()._name_search(

Check warning on line 43 in mrp_tag/models/mrp_tag.py

View check run for this annotation

Codecov / codecov/patch

mrp_tag/models/mrp_tag.py#L42-L43

Added lines #L42 - L43 were not covered by tests
name=name,
args=args,
domain=domain,
operator=operator,
limit=limit,
name_get_uid=name_get_uid,
order=order,
)

@api.constrains("parent_id")
Expand Down
1 change: 1 addition & 0 deletions mrp_tag/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
- Jasmin Solanki \<<jasmin.solanki@forgeflow.com>\>
- Arturo Arribas \<<aarribas@alquemy.es>\>
1 change: 1 addition & 0 deletions mrp_tag/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,7 @@ <h2><a class="toc-backref" href="#toc-entry-4">Authors</a></h2>
<h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
<ul class="simple">
<li>Jasmin Solanki &lt;<a class="reference external" href="mailto:jasmin.solanki&#64;forgeflow.com">jasmin.solanki&#64;forgeflow.com</a>&gt;</li>
<li>Arturo Arribas &lt;<a class="reference external" href="mailto:aarribas&#64;alquemy.es">aarribas&#64;alquemy.es</a>&gt;</li>
</ul>
</div>
<div class="section" id="maintainers">
Expand Down
2 changes: 1 addition & 1 deletion mrp_tag/views/mrp_production_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<field name="model">mrp.production</field>
<field name="inherit_id" ref="mrp.mrp_production_tree_view" />
<field name="arch" type="xml">
<field name="company_id" position="before">
<field name="state" position="before">
<field
name="tag_ids"
optional="hide"
Expand Down

0 comments on commit 962854e

Please sign in to comment.