Skip to content

Commit

Permalink
wms_connector: fix checking allowed to cancel
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastienbeau committed Mar 20, 2024
1 parent 5c2cdee commit 83f1f86
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion wms_connector/models/stock_picking.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,12 @@ def _compute_is_wms_exportable(self):
and rec.picking_type_id.code in ("incoming", "outgoing")
)

def _is_user_allowed_to_cancel(self):
return self.env.user.has_group("stock.group_stock_manager")

def action_force_cancel_wms(self):
self.env.user.has_group("stock.group_stock_manager")
if not self._is_user_allowed_to_cancel():
raise UserError(_("You are not allowed to cancel this picking"))
self.wms_export_date = None
self.wms_export_attachment_id = None
return self.with_context(skip_wms_cancel_check=True).action_cancel()
Expand Down

0 comments on commit 83f1f86

Please sign in to comment.