diff options
| -rwxr-xr-x | indoteknik_custom/models/sale_order.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py index d3971829..919d1a0b 100755 --- a/indoteknik_custom/models/sale_order.py +++ b/indoteknik_custom/models/sale_order.py @@ -101,10 +101,15 @@ class SaleOrder(models.Model): ], string='Web Approval', copy=False) compute_fullfillment = fields.Boolean(string='Compute Fullfillment', compute="_compute_fullfillment") note_ekspedisi = fields.Char(string="Note Ekspedisi") - date_kirim_ril = fields.Datetime(string='Tanggal Kirim SJ', related='picking_ids.date_doc_kirim', copy=False) + date_kirim_ril = fields.Datetime(string='Tanggal Kirim SJ', related='_compute_date_kirim', copy=False) date_driver_departure = fields.Datetime(string='Arrival Date', related='picking_ids.driver_arrival_date', copy=False) note_website = fields.Char(string="Note Website") + def _compute_date_kirim(self): + for rec in self: + picking = self.env['stock.picking'].search([('sale_id', '=', rec.id), ('state', 'not in', ['cancel'])], order='date_doc_kirim desc', limit=1) + rec.date_kirim_ril = picking.date_doc_kirim + def open_form_multi_create_uang_muka(self): action = self.env['ir.actions.act_window']._for_xml_id('indoteknik_custom.action_sale_order_multi_uangmuka') action['context'] = { |
