diff --git a/mrp_stock_move_cost/models/stock_move_line.py b/mrp_stock_move_cost/models/stock_move_line.py index bd96ba23..e0c5bd27 100644 --- a/mrp_stock_move_cost/models/stock_move_line.py +++ b/mrp_stock_move_cost/models/stock_move_line.py @@ -31,8 +31,10 @@ def create(self, vals_list): def write(self, vals): result = super().write(vals) - if self and "qty_done" in vals and self.state == "done": - self.search_production_and_update() + if "qty_done" in vals: + self.filtered( + lambda line: line.state == "done" + ).search_production_and_update() return result def search_production_and_update(self):