summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2024-01-26 15:12:17 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2024-01-26 15:12:17 +0700
commit8bb31d4a2f2c3037dad4acf8a8f280f9581b5d34 (patch)
tree3d212329fee40ae09658451be681430303f95788
parentb82d4d65aced4dc782ee6f2c42b84cc4ca67fddf (diff)
fix bug include_price
-rwxr-xr-xindoteknik_custom/models/purchase_pricelist.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/indoteknik_custom/models/purchase_pricelist.py b/indoteknik_custom/models/purchase_pricelist.py
index c756c301..805ebc89 100755
--- a/indoteknik_custom/models/purchase_pricelist.py
+++ b/indoteknik_custom/models/purchase_pricelist.py
@@ -34,7 +34,11 @@ class PurchasePricelist(models.Model):
@api.constrains('system_last_update','system_price','product_price','human_last_update','taxes_system_id','taxes_product_id')
def _contrains_include_price(self):
+
price_unit, taxes = self._get_valid_price()
+ if price_unit == 0:
+ self.include_price = 0
+ return
# taxes = self.taxes_system_id or self.taxes_product_id
# price_unit = self.system_price or self.product_price
tax_include = taxes.price_include