mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
[IMP] mrp_production_quant_manual_assign: select lots to be consumed
this feature is only useful for MOs of final product that are tracked by serial numbers.
This commit is contained in:
committed by
Alexis de Lattre
parent
df85afe7da
commit
c8560d28b1
1
mrp_production_quant_manual_assign/models/__init__.py
Normal file
1
mrp_production_quant_manual_assign/models/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import stock_move
|
||||
19
mrp_production_quant_manual_assign/models/stock_move.py
Normal file
19
mrp_production_quant_manual_assign/models/stock_move.py
Normal file
@@ -0,0 +1,19 @@
|
||||
# Copyright 2021 ForgeFlow S.L. (http://www.forgeflow.com)
|
||||
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
|
||||
|
||||
from odoo import models
|
||||
from odoo.tools.float_utils import float_is_zero
|
||||
|
||||
|
||||
class StockMove(models.Model):
|
||||
_inherit = "stock.move"
|
||||
|
||||
# While https://github.com/odoo/odoo/pull/74268 is not closed.
|
||||
def _should_bypass_set_qty_producing(self):
|
||||
res = super()._should_bypass_set_qty_producing()
|
||||
if self.has_tracking != "none" and float_is_zero(
|
||||
self.quantity_done, precision_rounding=self.product_uom.rounding
|
||||
):
|
||||
# If some serial/lot has been selected to be consumed we don't change the selection.
|
||||
return False
|
||||
return res
|
||||
Reference in New Issue
Block a user