Error in item-wise tax calculation: 'NoneType' object has no attribute 'fieldtype'

Hi,

I am facing a runtime error while working with item-level taxes in ERPNext.

Scenario:

  • Multiple tax rates (e.g. 10% and 20%) in a single document
  • Sales Taxes and Charges Template configured
  • Item-level tax defined on items

When submitting a POS Invoice / Sales Invoice, system throws:

AttributeError: ‘NoneType’ object has no attribute ‘fieldtype’

Traceback points to:
set_item_wise_tax_breakup()
→ get_itemised_tax_breakup_html()
→ update_itemised_tax_data()

It seems the error occurs while generating item-wise tax breakdown.

Additional observation:

  • The error references UAE regional override:
    erpnext/regional/united_arab_emirates/utils.py

But my setup is NOT UAE-based.

Questions:

  1. Why is UAE regional logic being triggered?
  2. Is this due to missing/invalid Account Head or Tax configuration?
  3. Is this a known issue with item-wise tax breakdown?

Environment:
frappe: 16.17.2
erpnext: 16.16.0
crm: 1.70.0
hrms: 16.6.0
Deployment: Self-hosted (Docker)

Any guidance would be appreciated.

@AHBT

You should choose one of the tax setup at a time for a sale;

  1. item tax template
  2. Sales tax charges and template

Accounting Setting is where you can configure it as running both of them at once will bring chaos.

Hi, I was able to figure out the root cause of my issue, so I wanted to share it in case it helps others.

The problem is related to the order of selecting the Tax Category in the Quotation form:

  • You need to select the Tax Category before adding items.

  • If items are added first, the item-level taxes defined in the Item do not get applied.

  • You can see this by opening the item row — the tax field is empty.

Also:

  • If you select the Tax Category after adding items, the system does not update the taxes automatically.

  • You have to manually go into each item row and reselect the tax, which is not obvious.

This is a bit confusing because the Tax Category field appears after the items section, so it’s natural to add items first.


Another point:

Even when the calculations are correct:

  • The system shows tax as a total at the bottom

  • Instead of clearly showing per-item tax like:


Item: 100
Tax: 10%
Total: 110

Overall, this behavior is not very intuitive and can easily lead to confusion for new users.

Just sharing my findings — maybe this can be improved in future versions.

1 Like