diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2024-01-10 10:05:04 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2024-01-10 10:05:04 +0700 |
| commit | 25748d7a8d537ffe6a3e905f59f05a4d737499d9 (patch) | |
| tree | 2c9fedcd797322a9086c5a0b6b66681139914713 | |
| parent | 893fbb7a4d1467686c4de435393f1162c4d04bd7 (diff) | |
bug fix add tax in purchase pricelist if not have tax in purchase order
| -rwxr-xr-x | indoteknik_custom/models/purchase_order.py | 8 |
1 files 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), |
