diff --git a/plm_automatic_weight/models/product_product.py b/plm_automatic_weight/models/product_product.py index b2a8804e..be801dcb 100755 --- a/plm_automatic_weight/models/product_product.py +++ b/plm_automatic_weight/models/product_product.py @@ -99,9 +99,12 @@ def write(self, vals): vals['weight'] = weight_cad + weight_additional elif product_id.automatic_compute_selection == 'use_normal_bom': vals['weight'] = weight_additional + product_id.weight_n_bom_computed + if product_id.weight==vals['weight']: + del vals['weight'] res = super(PlmComponent, self).write(vals) - for product_product_id in self: - product_product_id.fix_parent() + if 'weight' in vals: + for product_product_id in self: + product_product_id.fix_parent() return res def fix_parent(self):