summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiqdad <ahmadmiqdad27@gmail.com>2025-10-10 11:17:41 +0700
committerMiqdad <ahmadmiqdad27@gmail.com>2025-10-10 11:17:41 +0700
commite4b191155bf44bfcd58d6ae1b95d4a112bd43547 (patch)
tree70d339f1df6a15ba23c034fb045dfe22bd46f206
parent389820dab1629b4e34746e6acc51a6db50825f90 (diff)
<Miqdad> balikin driver dep date
-rw-r--r--indoteknik_custom/models/approval_date_doc.py2
-rw-r--r--indoteknik_custom/models/stock_picking.py11
2 files changed, 4 insertions, 9 deletions
diff --git a/indoteknik_custom/models/approval_date_doc.py b/indoteknik_custom/models/approval_date_doc.py
index 3ba3b8dc..638b44d7 100644
--- a/indoteknik_custom/models/approval_date_doc.py
+++ b/indoteknik_custom/models/approval_date_doc.py
@@ -40,7 +40,7 @@ class ApprovalDateDoc(models.Model):
raise UserError("Hanya Accounting Yang Bisa Approve")
self.check_invoice_so_picking
# Tambahkan context saat mengupdate date_doc_kirim
- self.picking_id.with_context(from_button_approve=True, allow_driver_departure_edit=True).write({
+ self.picking_id.with_context(from_button_approve=True).write({
'driver_departure_date': self.driver_departure_date,
'date_doc_kirim': self.driver_departure_date,
'update_date_doc_kirim_add': True
diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py
index 8a5888fc..4772c433 100644
--- a/indoteknik_custom/models/stock_picking.py
+++ b/indoteknik_custom/models/stock_picking.py
@@ -471,9 +471,9 @@ class StockPicking(models.Model):
if len(picking.scan_koli_lines) > 0:
if len(picking.scan_koli_lines) != picking.total_mapping_koli:
raise UserError("Scan Koli Tidak Sesuai Dengan Total Mapping Koli")
- picking.with_context(allow_driver_departure_edit=True).write({
- 'driver_departure_date': now
- })
+
+ picking.driver_departure_date = now
+
@api.depends('total_so_koli')
def _compute_total_so_koli(self):
for picking in self:
@@ -1654,11 +1654,6 @@ class StockPicking(models.Model):
line.sale_line_id = sale_line.id
def write(self, vals):
- allowed_user_ids = [17, 6277]
- if 'driver_departure_date' in vals:
- if self.env.user.id not in allowed_user_ids and not self.env.context.get('allow_driver_departure_edit'):
- raise UserError("Hanya Denise dan Faisal yang dapat mengubah Delivery Departure Date.")
-
if 'linked_manual_bu_out' in vals:
for record in self:
if (record.picking_type_code == 'internal'