summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/stock_picking.py
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2024-10-08 15:24:18 +0700
committerit-fixcomart <it@fixcomart.co.id>2024-10-08 15:24:18 +0700
commit2fcddbb073a04ed6ba0e9666a8ab5082a3ef4073 (patch)
treed4a3a423adf53ea8c086397abbcfe05a369fe637 /indoteknik_custom/models/stock_picking.py
parentec1e2331be248a505d89c00244d6b0fe5bd61c26 (diff)
parentce1c714c95f68b07f9b891600ba1e3b88288652c (diff)
Merge branch 'production' into iman/telegram
# Conflicts: # indoteknik_custom/models/__init__.py
Diffstat (limited to 'indoteknik_custom/models/stock_picking.py')
-rw-r--r--indoteknik_custom/models/stock_picking.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py
index 6f038386..14190474 100644
--- a/indoteknik_custom/models/stock_picking.py
+++ b/indoteknik_custom/models/stock_picking.py
@@ -125,7 +125,9 @@ class StockPicking(models.Model):
raise UserError('Hanya Logistic yang bisa mengubah shipping method')
def do_unreserve(self):
- if not self._context.get('darimana') == 'sale.order':
+ group_id = self.env.ref('indoteknik_custom.group_role_it').id
+ users_in_group = self.env['res.users'].search([('groups_id', 'in', [group_id])])
+ if not self._context.get('darimana') == 'sale.order' and self.env.user.id not in users_in_group.mapped('id'):
self.sale_id.unreserve_id = self.id
return self._create_approval_notification('Logistic')