mo_lock_consumed/models/stock_move.py
2026-02-06 18:05:38 +07:00

15 lines
444 B
Python

from odoo import models
class StockMove(models.Model):
_inherit = 'stock.move'
def _should_bypass_set_qty_producing(self):
"""
Prevent auto-update of consumed quantity if:
- The move already has a quantity set (partial consumption).
- The move is already picked.
"""
if self.quantity > 0 or self.picked:
return True
return super()._should_bypass_set_qty_producing()