[FIX] stock_landed_cost: added a missing return on the overridden write function

commit where the bug was introduced : https://github.com/odoo/odoo/pull/71810/commits/7b87ab31ee64d56c6e7f9eab7a51d81cf4e66747

opw-2572132

closes odoo/odoo#72751

X-original-commit: 94d1e807379ca7d92d5a4df267857cb00f979710
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
Signed-off-by: Djamel Touati <DjamelTouati@users.noreply.github.com>
This commit is contained in:
Touati Djamel (otd)
2021-06-24 18:19:31 +00:00
committed by William Henrotin
parent 603e13fa00
commit 2f098b2583
+3 -3
View File
@@ -18,6 +18,6 @@ class ProductTemplate(models.Model):
if (('type' in vals and vals['type'] != 'service') or ('landed_cost_ok' in vals and not vals['landed_cost_ok'])) and product.type == 'service' and product.landed_cost_ok:
if self.env['account.move.line'].search_count([('product_id', 'in', product.product_variant_ids.ids), ('is_landed_costs_line', '=', True)]):
raise UserError(_("You cannot change the product type or disable landed cost option because the product is used in an account move line."))
else:
vals['landed_cost_ok'] = False
super(ProductTemplate, product).write(vals)
vals['landed_cost_ok'] = False
return super().write(vals)