From 0237b0954d14a844203d62933d2d9f1f0b8c7bba Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Wed, 10 Jul 2024 09:54:21 +0700 Subject: fix bug description line --- indoteknik_custom/models/sale_order_line.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/indoteknik_custom/models/sale_order_line.py b/indoteknik_custom/models/sale_order_line.py index 1fee041d..1f90b821 100644 --- a/indoteknik_custom/models/sale_order_line.py +++ b/indoteknik_custom/models/sale_order_line.py @@ -153,18 +153,21 @@ class SaleOrderLine(models.Model): query = [('product_id', '=', line.product_id.id), ('vendor_id', '=', line.product_id.x_manufacture.override_vendor_id.id)] purchase_price = self.env['purchase.pricelist'].search( - query, limit=1, order='count_trx_po desc, count_trx_po_vendor desc') + query, limit=1, order='count_trx_po desc, count_trx_po_vendor desc') line.vendor_id = purchase_price.vendor_id line.tax_id = line.order_id.sales_tax_id price, taxes = line._get_valid_purchase_price(purchase_price) line.purchase_price = price - line_name = ('[' + line.product_id.default_code + ']' if line.product_id.default_code else '') + ' ' + (line.product_id.name if line.product_id.name else '') + ' ' + \ - ('(' + line.product_id.product_template_attribute_value_ids.name + ')' if line.product_id.product_template_attribute_value_ids.name else '') + ' ' + \ - (line.product_id.short_spesification if line.product_id.short_spesification else '') + attribute_values = line.product_id.product_template_attribute_value_ids.mapped('name') + attribute_values_str = ', '.join(attribute_values) if attribute_values else '' + + line_name = ('[' + line.product_id.default_code + ']' if line.product_id.default_code else '') + ' ' + \ + (line.product_id.name if line.product_id.name else '') + ' ' + \ + ('(' + attribute_values_str + ')' if attribute_values_str else '') + ' ' + \ + (line.product_id.short_spesification if line.product_id.short_spesification else '') line.name = line_name - def compute_delivery_amt_line(self): for line in self: try: -- cgit v1.2.3