summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2024-09-02 13:41:51 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2024-09-02 13:41:51 +0700
commit51e939b217a6ea0050cef2f5335b0dd310379b2d (patch)
treeab0ee56e4ae17d88fad3357ff4aa830222047f48
parentb3cddd483107f9cf97c2651262d5770ba6a13d92 (diff)
add permission to unreserve
-rw-r--r--indoteknik_custom/models/stock_picking.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py
index 6083e9e7..d16d508e 100644
--- a/indoteknik_custom/models/stock_picking.py
+++ b/indoteknik_custom/models/stock_picking.py
@@ -126,6 +126,8 @@ class StockPicking(models.Model):
def do_unreserve(self):
res = super(StockPicking, self).do_unreserve()
+ if not self.env.user.is_purchasing_manager:
+ raise UserError('Hanya Purchasing Manager yang bisa Unreserve')
current_time = datetime.datetime.utcnow()
self.date_unreserve = current_time
return res