[FIX] stock: update qty_done in move wizard
Scenario : Create a transfer on a product tracking by lot. Update the operation type "Receipt" by unchecking the "show reserved" option. Open the Register lots, pack, location wizard and set some lots with a quantity done. The quantity done field is not updated in real time. Issue : The depends function on quantity_done is triggered only on move_line_ids but "show reserverd" option replace move_line_ids by move_line_nosuggest_ids in the wizard.
This commit is contained in:
@@ -243,9 +243,9 @@ class StockMove(models.Model):
|
||||
""" This will return the move lines to consider when applying _quantity_done_compute on a stock.move.
|
||||
In some context, such as MRP, it is necessary to compute quantity_done on filtered sock.move.line."""
|
||||
self.ensure_one()
|
||||
return self.move_line_ids
|
||||
return self.move_line_ids or self.move_line_nosuggest_ids
|
||||
|
||||
@api.depends('move_line_ids.qty_done', 'move_line_ids.product_uom_id')
|
||||
@api.depends('move_line_ids.qty_done', 'move_line_ids.product_uom_id', 'move_line_nosuggest_ids.qty_done')
|
||||
def _quantity_done_compute(self):
|
||||
""" This field represents the sum of the move lines `qty_done`. It allows the user to know
|
||||
if there is still work to do.
|
||||
|
||||
Reference in New Issue
Block a user