[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:
Lois Rilo
2021-07-27 12:30:30 +02:00
committed by Alexis de Lattre
parent df85afe7da
commit c8560d28b1
10 changed files with 125 additions and 5 deletions

View File

@@ -0,0 +1 @@
from . import stock_move

View 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