From 44d1d87922f32066a1ce5548335a11403d118cf7 Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Tue, 29 Aug 2023 11:31:47 +0700 Subject: add purchase orders relation --- indoteknik_custom/models/stock_picking.py | 2 ++ indoteknik_custom/views/stock_picking.xml | 1 + 2 files changed, 3 insertions(+) diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py index 1ffb9aef..0ef77eac 100644 --- a/indoteknik_custom/models/stock_picking.py +++ b/indoteknik_custom/models/stock_picking.py @@ -72,6 +72,8 @@ class StockPicking(models.Model): waybill_id = fields.One2many(comodel_name='airway.bill', inverse_name='do_id', string='Airway Bill') purchase_representative_id = fields.Many2one('res.users', related='move_lines.purchase_line_id.order_id.user_id', string="Purchase Representative", readonly=True) + order_id = fields.Many2one('purchase.order', related='move_lines.purchase_line_id.order_id', + string="Purchase Orders", readonly=True) def action_create_invoice_from_mr(self): """Create the invoice associated to the PO. diff --git a/indoteknik_custom/views/stock_picking.xml b/indoteknik_custom/views/stock_picking.xml index 7aa66a6a..64917bad 100644 --- a/indoteknik_custom/views/stock_picking.xml +++ b/indoteknik_custom/views/stock_picking.xml @@ -58,6 +58,7 @@ + -- cgit v1.2.3