[FIX] mrp: domain on variant
Make sure there is a product set before searching the attributes, otherwise it crashes.
This commit is contained in:
@@ -290,6 +290,8 @@ class MrpBomLine(models.Model):
|
||||
|
||||
@api.onchange('parent_product_tmpl_id')
|
||||
def onchange_parent_product(self):
|
||||
if not self.parent_product_tmpl_id:
|
||||
return {}
|
||||
return {'domain': {'attribute_value_ids': [
|
||||
('id', 'in', self.parent_product_tmpl_id._get_valid_product_attribute_values().ids),
|
||||
('attribute_id.create_variant', '!=', 'no_variant')
|
||||
|
||||
Reference in New Issue
Block a user