diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2023-10-18 16:36:25 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2023-10-18 16:36:25 +0700 |
| commit | 0fe05527d92a45b38a3670241636b422c1054320 (patch) | |
| tree | 0a56332ae517910571387ce8d9e2eb4d9e671047 | |
| parent | 8e8782b2f1aa3fa61e2b326d2728736ed9969394 (diff) | |
add tax if exclude tax in purchase pricelist
| -rwxr-xr-x | indoteknik_custom/models/purchase_order.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py index 5e4617d4..59d5ac3e 100755 --- a/indoteknik_custom/models/purchase_order.py +++ b/indoteknik_custom/models/purchase_order.py @@ -56,6 +56,14 @@ class PurchaseOrder(models.Model): def add_product_to_pricelist(self): for line in self.order_line: current_time = datetime.utcnow() + 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: + price_unit = price_unit + (price_unit * tax_amt / 100) purchase_pricelist = self.env['purchase.pricelist'].search([ ('product_id', '=', line.product_id.id), |
