summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/purchase_pricelist.py
diff options
context:
space:
mode:
Diffstat (limited to 'indoteknik_custom/models/purchase_pricelist.py')
-rwxr-xr-xindoteknik_custom/models/purchase_pricelist.py26
1 files changed, 13 insertions, 13 deletions
diff --git a/indoteknik_custom/models/purchase_pricelist.py b/indoteknik_custom/models/purchase_pricelist.py
index b85df109..9c149ea9 100755
--- a/indoteknik_custom/models/purchase_pricelist.py
+++ b/indoteknik_custom/models/purchase_pricelist.py
@@ -32,20 +32,20 @@ class PurchasePricelist(models.Model):
else:
self.human_last_update = current_time
- # @api.constrains('system_last_update','system_price')
- # def _contrains_include_price(self):
- # taxes = self.taxes_system_id or self.taxes_product_id
- # tax_include = taxes.price_include
- # price_unit = self.system_price or self.product_price
- # if taxes:
- # if tax_include:
- # price_unit = price_unit
- # else:
- # price_unit = price_unit + (price_unit * 11 / 100)
- # else:
- # price_unit = price_unit + (price_unit * 11 / 100)
+ @api.constrains('system_last_update','system_price')
+ def _contrains_include_price(self):
+ taxes = self.taxes_system_id or self.taxes_product_id
+ tax_include = taxes.price_include
+ price_unit = self.system_price or self.product_price
+ if taxes:
+ if tax_include:
+ price_unit = price_unit
+ else:
+ price_unit = price_unit + (price_unit * 11 / 100)
+ else:
+ price_unit = price_unit + (price_unit * 11 / 100)
- # self.include_price = price_unit
+ self.include_price = price_unit
@api.constrains('vendor_id', 'product_id')
def _check_duplicate_purchase_pricelist(self):