From f7e412da7e3d2a106dee5a02e41101237213af2d Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Tue, 23 Jan 2024 13:02:48 +0700 Subject: add vendor to sale detail --- indoteknik_custom/models/sale_monitoring_detail.py | 3 ++- indoteknik_custom/views/sale_monitoring_detail.xml | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/indoteknik_custom/models/sale_monitoring_detail.py b/indoteknik_custom/models/sale_monitoring_detail.py index 196a09cd..ef2c832f 100755 --- a/indoteknik_custom/models/sale_monitoring_detail.py +++ b/indoteknik_custom/models/sale_monitoring_detail.py @@ -23,7 +23,7 @@ class SaleMonitoringDetail(models.Model): status = fields.Char(string="Status") qty_reserved = fields.Integer(string="Qty Reserved") note = fields.Char(string="Note") - vendor_id = fields.Many2one('res.partner', string='Vendor', related='sale_order_id.order_line.vendor_id') + vendor_id = fields.Many2one('res.partner', string='Vendor') def init(self): tools.drop_view_if_exists(self.env.cr, self._table) @@ -55,6 +55,7 @@ class SaleMonitoringDetail(models.Model): get_qty_po(so.id, sol.product_id) AS qty_po, get_qty_received(so.id, sol.product_id) AS qty_po_received, get_qty_reserved(so.id, sol.product_id) as qty_reserved, + get_vendor_id(so.id, sol.product_id) as vendor_id, sol.note_procurement as note FROM sale_order so JOIN sale_order_line sol ON sol.order_id = so.id diff --git a/indoteknik_custom/views/sale_monitoring_detail.xml b/indoteknik_custom/views/sale_monitoring_detail.xml index e1363894..5091fb83 100755 --- a/indoteknik_custom/views/sale_monitoring_detail.xml +++ b/indoteknik_custom/views/sale_monitoring_detail.xml @@ -76,6 +76,7 @@ + -- cgit v1.2.3