From 25748d7a8d537ffe6a3e905f59f05a4d737499d9 Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Wed, 10 Jan 2024 10:05:04 +0700 Subject: bug fix add tax in purchase pricelist if not have tax in purchase order --- indoteknik_custom/models/purchase_order.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py index 3c446fa7..44af8976 100755 --- a/indoteknik_custom/models/purchase_order.py +++ b/indoteknik_custom/models/purchase_order.py @@ -100,15 +100,19 @@ class PurchaseOrder(models.Model): for line in self.order_line: i += 1 current_time = datetime.utcnow() - print(i, len(self.order_line)) + # print(i, len(self.order_line)) price_unit = line.price_unit taxes = line.taxes_id for tax in taxes: tax_include = tax.price_include tax_amt = tax.amount if taxes: - if not tax_include: + if tax_include: price_unit = price_unit + (price_unit * tax_amt / 100) + else: + price_unit = price_unit + (price_unit * 11 / 100) + else: + price_unit = price_unit + (price_unit * 11 / 100) purchase_pricelist = self.env['purchase.pricelist'].search([ ('product_id', '=', line.product_id.id), -- cgit v1.2.3