summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/purchase_pricelist.py
diff options
context:
space:
mode:
authorHafidBuroiroh <hafidburoiroh09@gmail.com>2026-03-06 14:50:49 +0700
committerHafidBuroiroh <hafidburoiroh09@gmail.com>2026-03-06 14:50:49 +0700
commit9bcbad313a3101a10658e51f2475f8dfd6414c55 (patch)
treebb8d5fa714960e1dbf1ec5b4869c21abf942f818 /indoteknik_custom/models/purchase_pricelist.py
parent5c20bda1e65d72088af744481abf0784d30b710e (diff)
parent1d61c5c2f29270d2d1e9c84e887e9c94416d9027 (diff)
Merge branch 'odoo-backup' of https://bitbucket.org/altafixco/indoteknik-addons into refund_system
Diffstat (limited to 'indoteknik_custom/models/purchase_pricelist.py')
-rwxr-xr-xindoteknik_custom/models/purchase_pricelist.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/indoteknik_custom/models/purchase_pricelist.py b/indoteknik_custom/models/purchase_pricelist.py
index b3a473b6..83e06f55 100755
--- a/indoteknik_custom/models/purchase_pricelist.py
+++ b/indoteknik_custom/models/purchase_pricelist.py
@@ -118,15 +118,16 @@ class PurchasePricelist(models.Model):
product_domain = [('product_id', '=', rec.product_id.id)]
markup_pricelist = price_group['markup'].pricelist_id
- base_price = price_incl + (price_incl * markup_percentage / 100)
+ # base_price = price_incl + (price_incl * markup_percentage / 100)
+ base_price = round(price_incl + (price_incl * markup_percentage / 100), 12)
base_prod_pricelist = self.env['product.pricelist.item'].search(product_domain + [('pricelist_id', '=', markup_pricelist.id)], limit=1)
base_prod_pricelist.fixed_price = base_price
tier_percentages = [price_group[f'tier_{i}'][product_group] for i in range(1, 6)]
for i, tier_percentage in enumerate(tier_percentages):
tier_pricelist = price_group[f'tier_{i + 1}'].pricelist_id
- tier_price = price_incl + (price_incl * tier_percentage / 100)
- tier_perc = (base_price - tier_price) / base_price * 100
+ tier_price = round(price_incl + (price_incl * tier_percentage / 100), 12)
+ tier_perc = round((base_price - tier_price) / base_price * 100, 12)
tier_prod_pricelist = self.env['product.pricelist.item'].search(product_domain + [('pricelist_id', '=', tier_pricelist.id)], limit=1)
tier_prod_pricelist.price_discount = tier_perc