diff options
| author | Simon Lejeune <sle@openerp.com> | 2020-01-23 14:14:04 +0000 |
|---|---|---|
| committer | Nicolas Martinelli <nim@odoo.com> | 2020-01-24 11:48:13 +0000 |
| commit | 7ad5dd4d7d2aaacd4fd7642e4e4f818152111e41 (patch) | |
| tree | 2db831527f6add0e36efd18b66fea458f2bae4e5 | |
| parent | 3006636820c2c27a103f8fa69a75fc4661ce38a6 (diff) | |
[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
| -rw-r--r-- | addons/stock_account/models/product.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/stock_account/models/product.py b/addons/stock_account/models/product.py index be1048319a2..97b08f5fff1 100644 --- a/addons/stock_account/models/product.py +++ b/addons/stock_account/models/product.py @@ -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 |
