Skip to content

Commit

Permalink
[FIX] modify the validation to cancel procurement generated automatic
Browse files Browse the repository at this point in the history
  • Loading branch information
nicomacr committed Sep 3, 2018
1 parent b2e1907 commit 0b9b1b3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions stock_usability/models/procurement_order.py
Expand Up @@ -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')
Expand Down

0 comments on commit 0b9b1b3

Please sign in to comment.