[FIX] product: avoid traceback when accessing a product.product record

This reverts commit ed17f560fa 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#68114

X-original-commit: 0c77a856c35558331f43ea8b2e0c391965d3a705
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
This commit is contained in:
Andrea Grazioso (agr-odoo)
2021-03-18 16:56:28 +00:00
parent c3ae559bf7
commit 6cb4a5dacf
+2 -2
View File
@@ -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):