summaryrefslogtreecommitdiff
path: root/fixco_custom/models
diff options
context:
space:
mode:
authorMqdd <ahmadmiqdad27@gmail.com>2026-03-03 15:21:47 +0700
committerMqdd <ahmadmiqdad27@gmail.com>2026-03-03 15:21:47 +0700
commit68ec13f1520690382b05647a2a708a18ddc1defa (patch)
tree8759b5c84b285d0a790af860e3f25e3e865e30c7 /fixco_custom/models
parentfc1cdde83a1bf02889a0299c2b62e594327451f2 (diff)
<Miqdad> fix logistic cannot validate return picking & add iqmal permission in creating product
Diffstat (limited to 'fixco_custom/models')
-rw-r--r--fixco_custom/models/account_move.py11
-rwxr-xr-xfixco_custom/models/product_product.py2
2 files changed, 8 insertions, 5 deletions
diff --git a/fixco_custom/models/account_move.py b/fixco_custom/models/account_move.py
index 3f298d2..aa6d474 100644
--- a/fixco_custom/models/account_move.py
+++ b/fixco_custom/models/account_move.py
@@ -149,8 +149,9 @@ class AccountMove(models.Model):
])
def button_draft(self):
- if self.env.user.id not in [24, 13, 10, 2, 9, 15, 8, 11]:
- raise UserError("Hanya Finance yang bisa ubah Draft")
+ if not self.env.context.get('active_model') == 'stock.picking':
+ if self.env.user.id not in [24, 13, 10, 2, 9, 15, 8, 11]:
+ raise UserError("Hanya Finance yang bisa ubah Draft")
res = super(AccountMove, self).button_draft()
return res
@@ -309,8 +310,10 @@ class AccountMove(models.Model):
}
def action_post(self):
- if self.env.user.id not in [24, 13, 10, 2, 9, 15, 8, 22, 11]:
- raise UserError('Hanya Accounting yang bisa Post')
+ _logger.warning("CTX: %s", self.env.context)
+ if not self.env.context.get('active_model') == 'stock.picking':
+ if self.env.user.id not in [24, 13, 10, 2, 9, 15, 8, 22, 11]:
+ raise UserError('Hanya Accounting yang bisa Post')
for entry in self:
diff --git a/fixco_custom/models/product_product.py b/fixco_custom/models/product_product.py
index c9b4d32..536a47c 100755
--- a/fixco_custom/models/product_product.py
+++ b/fixco_custom/models/product_product.py
@@ -27,7 +27,7 @@ class ProductProduct(models.Model):
@api.model
def create(self, vals):
- allowed_user_ids = [2, 10, 12, 15]
+ allowed_user_ids = [2, 10, 12, 15, 13]
if self.env.user.id not in allowed_user_ids:
raise UserError(