summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/stock_picking.py
diff options
context:
space:
mode:
authorFIN-IT_AndriFP <it@fixcomart.co.id>2025-10-08 11:44:33 +0700
committerFIN-IT_AndriFP <it@fixcomart.co.id>2025-10-08 11:44:33 +0700
commit27657d8a4de29ae21ccc0562ab63dc7f1cd79f6b (patch)
tree3e093d644e4bf46f690c2c525db54887726030ce /indoteknik_custom/models/stock_picking.py
parent51155d702da715c82ea55322ee049d9b1ee34faa (diff)
parentd72c8fb9cd97552ef15aee0b70f7e1248b4c4696 (diff)
Merge branch 'odoo-backup' of https://bitbucket.org/altafixco/indoteknik-addons into odoo-backup
Diffstat (limited to 'indoteknik_custom/models/stock_picking.py')
-rw-r--r--indoteknik_custom/models/stock_picking.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py
index 4772c433..217e76cb 100644
--- a/indoteknik_custom/models/stock_picking.py
+++ b/indoteknik_custom/models/stock_picking.py
@@ -178,6 +178,14 @@ class StockPicking(models.Model):
area_name = fields.Char(string="Area", compute="_compute_area_name")
is_bu_iu = fields.Boolean('Is BU/IU', compute='_compute_is_bu_iu', default=False, copy=False, readonl=True)
+ @api.constrains('driver_departure_date')
+ def _constrains_driver_departure_date(self):
+ allowed_user_ids = [17, 6277, 25]
+ for record in self:
+ if record.driver_departure_date and self.env.user.id not in allowed_user_ids:
+ raise UserError("Hanya Denise dan Faishal yang dapat mengubah Delivery Departure Date.")
+
+
@api.depends('name')
def _compute_is_bu_iu(self):
for record in self: