diff options
| author | Mqdd <ahmadmiqdad27@gmail.com> | 2025-11-20 17:10:38 +0700 |
|---|---|---|
| committer | Mqdd <ahmadmiqdad27@gmail.com> | 2025-11-20 17:10:38 +0700 |
| commit | add0d418ab92e52197747f046d6d62e372ec4f97 (patch) | |
| tree | e23db561d1133722239ef98143e3cecee22b4f21 | |
| parent | 30f89c406b652f87ea2ab8c4515744a703d3bb8c (diff) | |
<Miqdad> fix coretax export
| -rw-r--r-- | indoteknik_custom/models/coretax_fatur.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/indoteknik_custom/models/coretax_fatur.py b/indoteknik_custom/models/coretax_fatur.py index cabcd5d6..755c5cc3 100644 --- a/indoteknik_custom/models/coretax_fatur.py +++ b/indoteknik_custom/models/coretax_fatur.py @@ -147,7 +147,15 @@ class CoretaxFaktur(models.Model): subtotal = line_price_subtotal quantity = line_quantity total_discount = round(line_discount, 2) - coretax_id = line.product_uom_id.coretax_id + if isinstance(line, dict): + product = line.get('product_id') + uom = product.uom_id if product else False + else: + uom = line.product_uom_id + + coretax_id = uom.coretax_id if uom else '' + + # coretax_id = line.product_uom_id.coretax_id # Calculate other tax values otherTaxBase = round(subtotal * (11 / 12), 2) if subtotal else 0 vat_amount = round(otherTaxBase * 0.12, 2) |
