diff options
| author | IT Fixcomart <it@fixcomart.co.id> | 2022-09-12 16:05:12 +0700 |
|---|---|---|
| committer | IT Fixcomart <it@fixcomart.co.id> | 2022-09-12 16:05:12 +0700 |
| commit | ed5b7ed656e9b4d790317612459a6b12197d136b (patch) | |
| tree | 53f856fc6e286db0bbbfa85daa413dc719da20bc /indoteknik_custom/models | |
| parent | b4cb2913b26644f11abc6f9ea73912a6d3072918 (diff) | |
delivery_order in sale_order and stock_picking
Diffstat (limited to 'indoteknik_custom/models')
| -rwxr-xr-x | indoteknik_custom/models/sale_order.py | 1 | ||||
| -rw-r--r-- | indoteknik_custom/models/stock_picking.py | 11 |
2 files changed, 12 insertions, 0 deletions
diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py index 6f901809..3db6e432 100755 --- a/indoteknik_custom/models/sale_order.py +++ b/indoteknik_custom/models/sale_order.py @@ -17,6 +17,7 @@ class SaleOrder(models.Model): ('pengajuan2', 'Approval Tyas'), ('approved', 'Approved'), ], string='Approval Status', readonly=True, copy=False, index=True, tracking=3) + carrier_id = fields.Many2one('delivery.carrier', string='Shipping Method') # def sale_order_approve(self): # for order in self: diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py index 5142bc5f..179faadd 100644 --- a/indoteknik_custom/models/stock_picking.py +++ b/indoteknik_custom/models/stock_picking.py @@ -1,4 +1,5 @@ from odoo import fields, models, api +from datetime import datetime class StockPicking(models.Model): @@ -9,6 +10,13 @@ class StockPicking(models.Model): is_efaktur_exported = fields.Boolean(string='Is eFaktur Exported') date_efaktur_exported = fields.Datetime(string='eFaktur Exported Date') + # Delivery Order + driver_departure_date = fields.Datetime(string='Driver Departure Date', readonly=True) + driver_arrival_date = fields.Datetime(string='Driver Arrival Date', readonly=True) + delivery_tracking_no = fields.Char(string='Delivery Tracking Number', readonly=True) + driver_id = fields.Many2one('res.users', string='Driver', readonly=True) + picking_code = fields.Char(string="Picking Code", readonly=True, copy=False) + @api.onchange('picking_type_id') def _onchange_operation_type(self): self.is_internal_use = self.picking_type_id.is_internal_use @@ -16,6 +24,9 @@ class StockPicking(models.Model): @api.model def create(self, vals): + if not self.picking_code: + vals['picking_code'] = self.env['ir.sequence'].next_by_code('stock.picking.code') or '0' + self._use_faktur(vals) return super(StockPicking, self).create(vals) |
