diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2024-09-02 13:26:11 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2024-09-02 13:26:11 +0700 |
| commit | 6e049ba60b4ee6e20231787af3e7e3c0abcf188a (patch) | |
| tree | c0838522fbc323e37ee224d977da301876d8e4fc | |
| parent | 1e44c76fa1b4f9aa63599a4efb0adb84b3adba75 (diff) | |
add permission to button validate stock picking
| -rw-r--r-- | indoteknik_custom/models/stock_picking.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py index 6083e9e7..49f2ec80 100644 --- a/indoteknik_custom/models/stock_picking.py +++ b/indoteknik_custom/models/stock_picking.py @@ -354,6 +354,9 @@ class StockPicking(models.Model): def button_validate(self): + if not self.env.user.is_purchasing_manager: + raise UserError("Harus di Approve oleh Purchasing Manager") + if self._name != 'stock.picking': return super(StockPicking, self).button_validate() |
