Skip to content

Commit

Permalink
[IMP] mrp_stock_move_cost: Improve ValueError: Expected singleton
Browse files Browse the repository at this point in the history
  • Loading branch information
unaiberis authored and anajuaristi committed Nov 21, 2024
1 parent 50b0b45 commit 35b46e0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions mrp_stock_move_cost/models/stock_move_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 35b46e0

Please sign in to comment.