summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorAndrea Grazioso (agr-odoo) <agr@odoo.com>2021-03-18 09:08:54 +0000
committerAndrea Grazioso (agr-odoo) <agr@odoo.com>2021-03-18 09:08:54 +0000
commit0c77a856c35558331f43ea8b2e0c391965d3a705 (patch)
treebf912f9bf59287df1624d8fbcd406919ec5e4b84 /addons
parent81ee677bd52db388e29c26e255ccab27a286cf94 (diff)
[FIX] product: avoid traceback when accessing a product.product record
This reverts commit ed17f560fa06e2d1c9e7495c9a4cbfe1cea5bce6 which introduced a check not needed anymore as the field measure_type does not exist any more since: https://github.com/odoo/odoo/commit/52ed0be17e80aa6bcc24d59620dd3462b6d577c3 opw-2482554 closes odoo/odoo#68054 Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
Diffstat (limited to 'addons')
-rw-r--r--addons/product/models/product_template.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/product/models/product_template.py b/addons/product/models/product_template.py
index 3b44b853820..e5c4588c5d6 100644
--- a/addons/product/models/product_template.py
+++ b/addons/product/models/product_template.py
@@ -284,9 +284,9 @@ class ProductTemplate(models.Model):
"""
product_weight_in_lbs_param = self.env['ir.config_parameter'].sudo().get_param('product.weight_in_lbs')
if product_weight_in_lbs_param == '1':
- return self.env.ref('uom.product_uom_lb', False) or self.env['uom.uom'].search([('measure_type', '=' , 'weight'), ('uom_type', '=', 'reference')], limit=1)
+ return self.env.ref('uom.product_uom_lb')
else:
- return self.env.ref('uom.product_uom_kgm', False) or self.env['uom.uom'].search([('measure_type', '=' , 'weight'), ('uom_type', '=', 'reference')], limit=1)
+ return self.env.ref('uom.product_uom_kgm')
@api.model
def _get_length_uom_id_from_ir_config_parameter(self):