Skip to content

Commit f97970c

Browse files
migration-bot-adhocmav-adhoc
authored andcommitted
[MIG] product_uoms: Migration to 19.0
1 parent 0f3c005 commit f97970c

File tree

5 files changed

+7
-12
lines changed

5 files changed

+7
-12
lines changed

product_uoms/__manifest__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
##############################################################################
2020
{
2121
"name": "Product UOMS",
22-
"version": "18.0.1.0.0",
22+
"version": "19.0.1.0.0",
2323
"category": "base.module_category_knowledge_management",
2424
"author": "ADHOC SA",
2525
"website": "www.adhoc.com.ar",
@@ -36,7 +36,7 @@
3636
"views/product_template_views.xml",
3737
"security/ir.model.access.csv",
3838
],
39-
"installable": False,
39+
"installable": True,
4040
"auto_install": False,
4141
"application": False,
4242
}

product_uoms/demo/product_product_demo.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
<odoo noupdate="1">
33
<record id="product_on_cm_saleable_on_m_and_km" model="product.product">
44
<field name="name">Product On Centimeter Saleable on Meter and Km</field>
5-
<field name="categ_id" ref="product.product_category_4"/>
65
<field name="uom_id" ref="uom.product_uom_cm"/>
7-
<field name="uom_po_id" ref="uom.product_uom_cm"/>
86
<field name="standard_price">1</field>
97
<field name="list_price">2</field>
108
<field name="type">consu</field>

product_uoms/models/product_template.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@
99
class ProductTemplate(models.Model):
1010
_inherit = "product.template"
1111

12-
uom_category_id = fields.Many2one(
13-
related="uom_id.category_id",
14-
)
1512
uom_ids = fields.One2many(
1613
"product.uoms",
1714
"product_tmpl_id",

product_uoms/models/product_uoms.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class ProductUoms(models.Model):
2020
required=True,
2121
)
2222

23-
_sql_constraints = [
24-
("uom_uniq", "unique(product_tmpl_id, uom_id)", ("UOM must be unique per Product Template!")),
25-
]
23+
_uom_uniq = models.Constraint(
24+
"unique(product_tmpl_id, uom_id)",
25+
"UOM must be unique per Product Template!",
26+
)

product_uoms/views/product_template_views.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@
77
<field name="inherit_id" ref="product.product_template_form_view"/>
88
<field name="arch" type="xml">
99
<field name="product_tooltip" position="after">
10-
<field name="uom_category_id" invisible="1"/>
1110
<field name="uom_ids">
1211
<list editable="bottom">
1312
<field name="sequence" widget="handle"/>
14-
<field name="uom_id" domain="[('category_id', '=', parent.uom_category_id)]" options="{'no_create': True, 'no_open': True}"/>
13+
<field name="uom_id" options="{'no_create': True, 'no_open': True}"/>
1514
</list>
1615
</field>
1716
</field>

0 commit comments

Comments
 (0)