summaryrefslogtreecommitdiff
path: root/addons/mrp_subcontracting/models/stock_picking.py
diff options
context:
space:
mode:
authorArnold Moyaux <arm@odoo.com>2020-01-02 09:42:12 +0000
committerArnold Moyaux <arm@odoo.com>2020-01-02 18:11:33 +0000
commitea340afafa90bc6bc421a83d3ae1977efac808f4 (patch)
treea17e33a24b2568b82a9cb3231cb8dfbde41fffec /addons/mrp_subcontracting/models/stock_picking.py
parent858c9ec3945a40961b5e18aa1ead725a3a1fde45 (diff)
[FIX] mrp_subcontracting: cancel a PO should cancel delivery
When subcontracting a product via a purchase order and not a simple receipt. Then the cancelation of the receipt will not only cancel the receipt of the finished product but not the delivery for the components. It happens because button_cancel on purchase order will call _action_cancel the stock.move linked to purchase order line. It will not call action_cancel on the stock.picking. However the part responsible for the cancelation of components delivery is in the stock.picking action_cancel method. Move the stock.picking action_cancel logic in the stock.move _action_cancel method since it's always call for both usecase. Fixes #42551 closes odoo/odoo#42653 X-original-commit: 841305f271411c3a67af271ac09da9ce0922f100 Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
Diffstat (limited to 'addons/mrp_subcontracting/models/stock_picking.py')
-rw-r--r--addons/mrp_subcontracting/models/stock_picking.py5
1 files changed, 0 insertions, 5 deletions
diff --git a/addons/mrp_subcontracting/models/stock_picking.py b/addons/mrp_subcontracting/models/stock_picking.py
index e3040792084..29c44aec51b 100644
--- a/addons/mrp_subcontracting/models/stock_picking.py
+++ b/addons/mrp_subcontracting/models/stock_picking.py
@@ -36,11 +36,6 @@ 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):
res = super(StockPicking, self)._action_done()
productions = self.env['mrp.production']