summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMqdd <ahmadmiqdad27@gmail.com>2025-12-01 09:31:53 +0700
committerMqdd <ahmadmiqdad27@gmail.com>2025-12-01 09:31:53 +0700
commit73296b2a5e1baaa29770d4d91482c95d93740572 (patch)
tree23bcfeda1e9af0c5e9916bcc09300e51ac361038
parent781b4a10102836443357a941e68a333edefbdf76 (diff)
<Miqdad> uom bquick in invoice always unit in coretax xml
-rw-r--r--indoteknik_custom/models/coretax_fatur.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/indoteknik_custom/models/coretax_fatur.py b/indoteknik_custom/models/coretax_fatur.py
index 755c5cc3..d93ca7b7 100644
--- a/indoteknik_custom/models/coretax_fatur.py
+++ b/indoteknik_custom/models/coretax_fatur.py
@@ -117,7 +117,7 @@ class CoretaxFaktur(models.Model):
)
# Calculate totals
- total_product_amount = sum(line.get('price_subtotal', 0) if isinstance(line, dict)
+ total_product_amount = sum(line.get('price_subtotal', 0) if isinstance(line, dict)
else line.price_subtotal for line in product_lines)
if total_product_amount == 0:
total_product_amount = 1 # Avoid division by zero
@@ -153,7 +153,10 @@ class CoretaxFaktur(models.Model):
else:
uom = line.product_uom_id
- coretax_id = uom.coretax_id if uom else ''
+ coretax_id = uom.coretax_id if uom else 'UM.0018'
+ bquick_id = 80007
+ if invoice.partner_id.id == bquick_id:
+ coretax_id = 'UM.0018'
# coretax_id = line.product_uom_id.coretax_id
# Calculate other tax values