From 09b6010d3522e1c639936a90be4b4af30312d3cd Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Mon, 19 Oct 2020 10:29:30 +0000 Subject: [PATCH] [FIX] stock: Cancelled DO changed to Ready State to reproduce the bug: - Let's consider a 2 steps delivery setting - Create a SO with a product P and a quantity Q and confirm it - Pick: Deliver a smaller quantity than Q, don't create a backorder but duplicate the Pick and validate it with the remaining quantity. - Out: the initial delivery order OUT P1 does not allow the reservation, so cancel it and duplicate it (let's call it P2). - Click on Mark to do on P2 Bug: The initial picking OUT P1 was changed in state Ready instead of keeping in state Cancelled opw:2339217 closes odoo/odoo#60391 X-original-commit: 61734cdaf1cf6857125b1ece63928ab080359c6c Signed-off-by: Simon Goffin (sig) Co-authored-by: Whenrow --- addons/sale_stock/models/sale_order.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale_stock/models/sale_order.py b/addons/sale_stock/models/sale_order.py index b805e6a9137..e856e9a1732 100644 --- a/addons/sale_stock/models/sale_order.py +++ b/addons/sale_stock/models/sale_order.py @@ -203,7 +203,7 @@ class SaleOrder(models.Model): picking_id = picking_id[0] else: picking_id = pickings[0] - action['context'] = dict(self._context, default_partner_id=self.partner_id.id, default_picking_id=picking_id.id, default_picking_type_id=picking_id.picking_type_id.id, default_origin=self.name, default_group_id=picking_id.group_id.id) + action['context'] = dict(self._context, default_partner_id=self.partner_id.id, default_picking_type_id=picking_id.picking_type_id.id, default_origin=self.name, default_group_id=picking_id.group_id.id) return action def action_cancel(self):