diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2025-05-23 15:06:29 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2025-05-23 15:06:29 +0700 |
| commit | 76d5328565d394c5e78c56c7c2fc37e5470022ce (patch) | |
| tree | 4039a41e083188ee29dbe642f11917f4806f44ee /indoteknik_custom/models/automatic_purchase.py | |
| parent | 936c6cf2c1aea0e2b470d20d6fd41a10380bcac0 (diff) | |
refactor get valid purchase price cause of null in tax purchase
Diffstat (limited to 'indoteknik_custom/models/automatic_purchase.py')
| -rw-r--r-- | indoteknik_custom/models/automatic_purchase.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/indoteknik_custom/models/automatic_purchase.py b/indoteknik_custom/models/automatic_purchase.py index b66121e1..c5cc686a 100644 --- a/indoteknik_custom/models/automatic_purchase.py +++ b/indoteknik_custom/models/automatic_purchase.py @@ -589,18 +589,18 @@ class AutomaticPurchaseLine(models.Model): def _get_valid_purchase_price(self, purchase_price): price = 0 - taxes = '' + taxes = 24 human_last_update = purchase_price.human_last_update or datetime.min system_last_update = purchase_price.system_last_update or datetime.min - if purchase_price.taxes_product_id.type_tax_use == 'purchase': - price = purchase_price.product_price - taxes = purchase_price.taxes_product_id.id + #if purchase_price.taxes_product_id.type_tax_use == 'purchase': + price = purchase_price.product_price + taxes = purchase_price.taxes_product_id.id or 24 if system_last_update > human_last_update: - if purchase_price.taxes_system_id.type_tax_use == 'purchase': - price = purchase_price.system_price - taxes = purchase_price.taxes_system_id.id + #if purchase_price.taxes_system_id.type_tax_use == 'purchase': + price = purchase_price.system_price + taxes = purchase_price.taxes_system_id.id or 24 return price, taxes |
