diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2025-03-19 09:55:02 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2025-03-19 09:55:02 +0700 |
| commit | 4a7b5ebc82de37c6d2bde5e670066336256939d5 (patch) | |
| tree | 320b8faa3737ee07672f8380d75b6f92e297f4ff /indoteknik_custom/models/stock_picking.py | |
| parent | a06059e47feab3aa25c35652dfb83b8783273084 (diff) | |
cr reklas uang muka and permission button cancel stock picking
Diffstat (limited to 'indoteknik_custom/models/stock_picking.py')
| -rw-r--r-- | indoteknik_custom/models/stock_picking.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py index ab8109c7..4229d33e 100644 --- a/indoteknik_custom/models/stock_picking.py +++ b/indoteknik_custom/models/stock_picking.py @@ -1008,9 +1008,12 @@ class StockPicking(models.Model): return True def action_cancel(self): - if not self.env.user.is_logistic_approver and self.env.context.get('active_model') == 'stock.picking': + if not self.env.user.is_logistic_approver: if self.origin and 'Return of' in self.origin: raise UserError("Button ini hanya untuk Logistik") + + if not self.env.user.has_group('indoteknik_custom.group_role_it') and not self.env.user.has_group('indoteknik_custom.group_role_logistic'): + raise UserError("Button ini hanya untuk Logistik") res = super(StockPicking, self).action_cancel() return res |
