diff options
| -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) |
