summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiqdad <ahmadmiqdad27@gmail.com>2025-10-06 14:09:41 +0700
committerMiqdad <ahmadmiqdad27@gmail.com>2025-10-06 14:09:41 +0700
commitf9645a14ad98a901ae66340b87c592f7a0701d01 (patch)
treea99bdf23e6201cad262a7976ebfd12a220310e7b
parent8fe189d8f4caeed4b1aff764abc005b4e4ab3979 (diff)
<Miqdad> add more vals
-rw-r--r--indoteknik_custom/models/stock_picking.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py
index be0d77ac..a9c09ab7 100644
--- a/indoteknik_custom/models/stock_picking.py
+++ b/indoteknik_custom/models/stock_picking.py
@@ -194,8 +194,9 @@ class StockPicking(models.Model):
raise UserError("Harus Ask Approval terlebih dahulu")
if rec.approval_status in ['pengajuan1'] and self.env.user.is_accounting:
rec.approval_status = 'pengajuan2'
- # raise UserError(_("Hanya bisa dijalankan saat status di 'pengajuan1'."))
rec.message_post(body=_("Status naik ke Approval Logistik oleh %s") % self.env.user.display_name)
+ if rec.approval_status in ['pengajuan1', 'pengajuan2', ''] and not self.env.user.is_accounting:
+ raise UserError("Tombol hanya untuk accounting")
return True