Skip to content
Snippets Groups Projects
Commit 8bec87d0 authored by Goffin Simon's avatar Goffin Simon
Browse files

[FIX] mrp_subcontracting: Updat quantity on confirmed PO


Steps to reproduce the bug:

- Let's consider a product P with a subcontracting BOM B and subcontractor S
- Create a purchase order PO with S as vendor
- Add P on PO and confirm it
- Change quantity of P two times

Bug:

A traceback was raised

opw:2419222

closes odoo/odoo#66440

Signed-off-by: default avatarSimon Goffin (sig) <sig@openerp.com>
parent 23e54113
No related branches found
No related tags found
No related merge requests found
......@@ -196,7 +196,7 @@ operations.""") % ('\n'.join(overprocessed_moves.mapped('product_id.display_name
def _update_subcontract_order_qty(self, quantity):
for move in self:
quantity_change = quantity - move.product_uom_qty
production = move.move_orig_ids.production_id
production = move.move_orig_ids.production_id.filtered(lambda p: p.state != 'cancel')
if production:
self.env['change.production.qty'].with_context(skip_activity=True).create({
'mo_id': production.id,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment