From 39c5d0f35efbfbd43fbcc8e8ad48a9477b8fd77c Mon Sep 17 00:00:00 2001 From: Arnold Moyaux Date: Wed, 14 Aug 2019 14:14:16 +0000 Subject: [PATCH] [IMP] mrp_subcontracting: cancel subcontract order A subcontracting receipt cancellation should cancel the subcontracting order and the associated document. --- addons/mrp_subcontracting/models/stock_picking.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/addons/mrp_subcontracting/models/stock_picking.py b/addons/mrp_subcontracting/models/stock_picking.py index cd310f5ea3f..00a6fbbd11a 100644 --- a/addons/mrp_subcontracting/models/stock_picking.py +++ b/addons/mrp_subcontracting/models/stock_picking.py @@ -32,6 +32,12 @@ class StockPicking(models.Model): # ------------------------------------------------------------------------- # Action methods # ------------------------------------------------------------------------- + + def action_cancel(self): + for picking in self: + picking._get_subcontracted_productions()._action_cancel() + return super(StockPicking, self).action_cancel() + def action_done(self): # action_done with an extra move will trigger two methods that # create/modify a subcontracting order, _action_confirm and a write on