From 6e049ba60b4ee6e20231787af3e7e3c0abcf188a Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Mon, 2 Sep 2024 13:26:11 +0700 Subject: add permission to button validate stock picking --- indoteknik_custom/models/stock_picking.py | 3 +++ 1 file changed, 3 insertions(+) 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() -- cgit v1.2.3