[FIX] stock_account: _run_fifo_vacuum
If the oldest problematic layer cannot be fixed, no need to try to fix later one. X-original-commit: f7ccf2b16803f05584fb094471b08f6836d892a1
This commit is contained in:
committed by
Nicolas Martinelli
parent
3006636820
commit
7ad5dd4d7d
@@ -334,7 +334,7 @@ class ProductProduct(models.Model):
|
||||
('remaining_qty', '<', 0),
|
||||
('stock_move_id', '!=', False),
|
||||
('company_id', '=', company.id),
|
||||
])
|
||||
], order='create_date, id')
|
||||
for svl_to_vacuum in svls_to_vacuum:
|
||||
domain = [
|
||||
('company_id', '=', svl_to_vacuum.company_id.id),
|
||||
@@ -348,7 +348,7 @@ class ProductProduct(models.Model):
|
||||
]
|
||||
candidates = self.env['stock.valuation.layer'].sudo().search(domain)
|
||||
if not candidates:
|
||||
continue
|
||||
break
|
||||
qty_to_take_on_candidates = abs(svl_to_vacuum.remaining_qty)
|
||||
qty_taken_on_candidates = 0
|
||||
tmp_value = 0
|
||||
|
||||
Reference in New Issue
Block a user