summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnold Moyaux <arm@odoo.com>2019-08-14 14:14:16 +0000
committerArnold Moyaux <arm@odoo.com>2019-08-19 15:03:59 +0000
commit39c5d0f35efbfbd43fbcc8e8ad48a9477b8fd77c (patch)
treed0e699777b5adc545ceb52c0598b05d8b243d866
parenta3aeabd44d36dd735d4bfd78c65fc8f850578c60 (diff)
[IMP] mrp_subcontracting: cancel subcontract order
A subcontracting receipt cancellation should cancel the subcontracting order and the associated document.
-rw-r--r--addons/mrp_subcontracting/models/stock_picking.py6
1 files changed, 6 insertions, 0 deletions
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