From 0b9b1b3496638ca8c69077aa793c9133f78f9712 Mon Sep 17 00:00:00 2001 From: nicomacr Date: Mon, 3 Sep 2018 16:16:02 -0300 Subject: [PATCH] [FIX] modify the validation to cancel procurement generated automatic --- stock_usability/models/procurement_order.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stock_usability/models/procurement_order.py b/stock_usability/models/procurement_order.py index 8f81eff4..19ebd8cc 100644 --- a/stock_usability/models/procurement_order.py +++ b/stock_usability/models/procurement_order.py @@ -35,10 +35,10 @@ def button_cancel_remaining(self): raise ValidationError(_( 'Solo puede cancelar abastecimientos primarios no los ' 'encadenados')) - if rec.rule_id.action != 'move': + if rec.rule_id.action not in ['move', 'buy']: raise ValidationError(_( 'Cancel remaining in procurements is only implmented for ' - 'rules with action of type "move"')) + 'rules with action of type "move" or "buy"')) not_done_moves = rec.move_ids.filtered( lambda x: x.state != 'done')