From 2eb8f009b4e0c0e0b88d2ec16a5bee095085b828 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Mon, 26 Oct 2015 12:23:36 +0100 Subject: [PATCH] [FIX] purchase: action_cancel Action_cancel must be done on each stock.picking(with state!='cancel') linked to the purchase order like in the revision 5aeccbd. opw:652995 --- addons/purchase/purchase.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index 3d669a0cfaa..0bcfca34b0f 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -285,6 +285,8 @@ class PurchaseOrder(models.Model): if inv and inv.state not in ('cancel', 'draft'): raise UserError(_("Unable to cancel this purchase order.i You must first cancel related vendor bills.")) + for pick in order.picking_ids.filtered(lambda r: r.state != 'cancel'): + pick.action_cancel() if not self.env.context.get('cancel_procurement'): procurements = order.order_line.mapped('procurement_ids') procurements.filtered(lambda r: r.state not in ('cancel', 'exception') and r.rule_id.propagate).write({'state': 'cancel'})