Skip to content

Commit

Permalink
[13.0] [IMP] stock_ux: Restrict to cancel picking with the picking ca…
Browse files Browse the repository at this point in the history
…ncelation allow.
  • Loading branch information
nicomacr authored and jjscarafia committed Mar 15, 2021
1 parent 8cdc923 commit 4433e82
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions stock_ux/models/stock_picking.py
Expand Up @@ -154,3 +154,9 @@ def _check_backorder(self):
pack.qty_done, pack.product_id.uom_id)
return any(quantity_done[x] < quantity_todo.get(x, 0)
for x in quantity_done)

@api.constrains('state')
def check_cancel(self):
if self.filtered(
lambda x: x.state == 'cancel' and not self.user_has_groups('stock_ux.allow_picking_cancellation')):
raise ValidationError("Only User with 'Picking cancelation allow' rights can cancel pickings")

0 comments on commit 4433e82

Please sign in to comment.