summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2024-07-10 09:54:21 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2024-07-10 09:54:21 +0700
commit0237b0954d14a844203d62933d2d9f1f0b8c7bba (patch)
tree48a151b0da776b5f4d728f21116c92651ab263f0
parent591c0f5f424376df11bae6f52944d09627b129b4 (diff)
fix bug description line
-rw-r--r--indoteknik_custom/models/sale_order_line.py13
1 files 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: