diff options
Diffstat (limited to 'indoteknik_custom/models')
| -rw-r--r-- | indoteknik_custom/models/stock_picking.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py index d35cd9b8..0385566e 100644 --- a/indoteknik_custom/models/stock_picking.py +++ b/indoteknik_custom/models/stock_picking.py @@ -70,6 +70,17 @@ class StockPicking(models.Model): ('partial', 'Kirim Parsial') ], string='Note', help='jika field ini diisi maka tidak akan dihitung ke lead time') waybill_id = fields.One2many(comodel_name='airway.bill', inverse_name='do_id', string='Airway Bill') + purchase_representative = fields.Char(compute='_compute_purchase_representative') + + def _compute_purchase_representative(self): + for record in self: + po = self.env['purchase.order'].search([ + ('name', '=', record.group_id.name) + ]) + if po: + record.purchase_representative = po[0].user_id.name + else: + record.purchase_representative = False def action_create_invoice_from_mr(self): """Create the invoice associated to the PO. |
