From 16ddcb43b85c1deeda29bf6bb5db4ef73b8d20d2 Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Wed, 2 Oct 2024 16:21:55 +0700 Subject: add suggested vendor by md, use later --- indoteknik_custom/models/sale_order_line.py | 2 ++ indoteknik_custom/views/sale_order.xml | 1 + 2 files changed, 3 insertions(+) diff --git a/indoteknik_custom/models/sale_order_line.py b/indoteknik_custom/models/sale_order_line.py index d1dcd0af..14bb8c99 100644 --- a/indoteknik_custom/models/sale_order_line.py +++ b/indoteknik_custom/models/sale_order_line.py @@ -32,6 +32,7 @@ class SaleOrderLine(models.Model): reserved_from = fields.Char(string='Reserved From', copy=False) item_percent_margin_without_deduction = fields.Float('%Margin', compute='_compute_item_margin_without_deduction') weight = fields.Float(string='Weight') + md_vendor_id = fields.Many2one('res.partner', string='MD Vendor', readonly=True) @api.constrains('note_procurement') def note_procurement_to_apo(self): @@ -245,6 +246,7 @@ class SaleOrderLine(models.Model): # query, limit=1, order='count_trx_po desc, count_trx_po_vendor desc') price, taxes, vendor_id = self._get_purchase_price(line.product_id) line.vendor_id = vendor_id + line.md_vendor_id = vendor_id line.tax_id = line.order_id.sales_tax_id # price, taxes = line._get_valid_purchase_price(purchase_price) line.purchase_price = price diff --git a/indoteknik_custom/views/sale_order.xml b/indoteknik_custom/views/sale_order.xml index 029c99e9..1c75c96a 100755 --- a/indoteknik_custom/views/sale_order.xml +++ b/indoteknik_custom/views/sale_order.xml @@ -135,6 +135,7 @@ + -- cgit v1.2.3