[FIX] mrp_subcontracting: multi-step receipt
- Activate the multi-step reception - Create a Subcontracting BOM for product P and supplier S. - Create a PO for S with P - Validate the PO - Validate the input transfer - Validate the internal transfer A error is raised because a mandatory field is not set. The root cause comes from the INT move being flagged as a subcontract move, while it shouldn't be. Indeed, only the input move should be flagged as subcontract. We force the `is_subcontract` value to `False` when a move is copied in the context of a stock rule. opw-2193009 opw-2202727 closes odoo/odoo#46115 X-original-commit: 8795e0f3d4301710a089d263395633759eae76b7 Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This commit is contained in:
@@ -7,5 +7,6 @@ from . import res_partner
|
||||
from . import stock_move
|
||||
from . import stock_move_line
|
||||
from . import stock_picking
|
||||
from . import stock_rule
|
||||
from . import stock_warehouse
|
||||
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import models
|
||||
|
||||
|
||||
class StockRule(models.Model):
|
||||
_inherit = "stock.rule"
|
||||
|
||||
def _push_prepare_move_copy_values(self, move_to_copy, new_date):
|
||||
new_move_vals = super(StockRule, self)._push_prepare_move_copy_values(move_to_copy, new_date)
|
||||
new_move_vals["is_subcontract"] = False
|
||||
return new_move_vals
|
||||
Reference in New Issue
Block a user