diff options
| author | Miqdad <ahmadmiqdad27@gmail.com> | 2025-10-09 14:55:00 +0700 |
|---|---|---|
| committer | Miqdad <ahmadmiqdad27@gmail.com> | 2025-10-09 14:55:00 +0700 |
| commit | b25d39b4d5dd456ef2e40a25ce3608e5c9b6694d (patch) | |
| tree | ed796c0126075e758a075ded75b4753135a66086 | |
| parent | 393958c36bf49b7b2dbd888b81c345b7734151a0 (diff) | |
<Miqdad> fix delivery departure date validation
| -rw-r--r-- | indoteknik_custom/models/stock_picking.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py index 87182277..8a5888fc 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.driver_departure_date = now - + picking.with_context(allow_driver_departure_edit=True).write({ + 'driver_departure_date': now + }) @api.depends('total_so_koli') def _compute_total_so_koli(self): for picking in self: @@ -1654,10 +1654,10 @@ 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.") + 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: |
