Skip to content

Commit

Permalink
[FIX]stock_ux:constrain check_cancel
Browse files Browse the repository at this point in the history
closes #475

X-original-commit: 6ba2a36
Signed-off-by: Bruno Zanotti <bz@adhoc.com.ar>
  • Loading branch information
jcadhoc authored and bruno-zanotti committed May 15, 2024
1 parent cd662fe commit 67539b5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions stock_ux/models/stock_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,3 +184,7 @@ def check_cancel(self):
if self.filtered(
lambda x: x.picking_id and 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")

def _merge_moves(self, merge_into=False):
# 22/04/2024: Agregamos esto porque sino al intentar confirmar compras con usuarios sin permisos, podia pasar que salga la constrain de arriba (check_cancel)
return super(StockMove,self.with_context(cancel_from_order=True))._merge_moves(merge_into = merge_into)

0 comments on commit 67539b5

Please sign in to comment.