diff options
Diffstat (limited to 'indoteknik_custom/models/stock_move.py')
| -rw-r--r-- | indoteknik_custom/models/stock_move.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/indoteknik_custom/models/stock_move.py b/indoteknik_custom/models/stock_move.py index cd061946..32ef312f 100644 --- a/indoteknik_custom/models/stock_move.py +++ b/indoteknik_custom/models/stock_move.py @@ -19,17 +19,17 @@ class StockMove(models.Model): if product and move.product_id != product: continue # Skip moves that don't match the specified product moves_to_unreserve.add(move.id) - + moves_to_unreserve = self.env['stock.move'].browse(moves_to_unreserve) ml_to_update, ml_to_unlink = OrderedSet(), OrderedSet() moves_not_to_recompute = OrderedSet() - + for ml in moves_to_unreserve.move_line_ids: if product and ml.product_id != product: continue # Only affect the specified product - if quantity > 0: + if quantity is not None and quantity > 0: # Only reduce by the specified quantity if it is greater than zero ml_to_update.add(ml.id) remaining_qty = ml.product_uom_qty - quantity @@ -40,7 +40,7 @@ class StockMove(models.Model): else: ml_to_unlink.add(ml.id) moves_not_to_recompute.add(ml.move_id.id) - + ml_to_update, ml_to_unlink = self.env['stock.move.line'].browse(ml_to_update), self.env['stock.move.line'].browse(ml_to_unlink) moves_not_to_recompute = self.env['stock.move'].browse(moves_not_to_recompute) @@ -49,6 +49,7 @@ class StockMove(models.Model): return True + def _prepare_account_move_line_from_mr(self, po_line, qty, move=False): po_line.ensure_one() aml_currency = move and move.currency_id or po_line.currency_id |
