summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2024-10-02 16:21:55 +0700
committerstephanchrst <stephanchrst@gmail.com>2024-10-02 16:21:55 +0700
commit16ddcb43b85c1deeda29bf6bb5db4ef73b8d20d2 (patch)
tree3da704581c75cdd019b381f318d50d968f1e7325
parent8b63d79efe0137ce6af535847f33868e73ce8d3c (diff)
add suggested vendor by md, use later
-rw-r--r--indoteknik_custom/models/sale_order_line.py2
-rwxr-xr-xindoteknik_custom/views/sale_order.xml1
2 files changed, 3 insertions, 0 deletions
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 @@
<field name="weight" optional="hide"/>
<field name="amount_voucher_disc" string="Voucher" readonly="1" optional="hide"/>
<field name="order_promotion_id" string="Promotion" readonly="1" optional="hide"/>
+ <field name="md_vendor_id" string="MD Vendor" readonly="1" optional="hide"/>
</xpath>
<xpath expr="//form/sheet/notebook/page/field[@name='order_line']/tree/field[@name='product_id']" position="before">
<field name="line_no" readonly="1" optional="hide"/>