Object is not subscriptable when submitting sales invoice for customer with GST category "SEZ"

I created a customer with GST category as SEZ and when i raise a Sales Invoice for this customer, and submit, i get below error

TypeError: ‘NoneType’ object is not subscriptable

I am able to raise successfully when the GST category is Registered Regular

Can anyone help me please?

You are accessing a nil variable for example:

In [12]: list1 = [2, 1]
    ...: print(list1)
    ...: list.sort(list1)
    ...: print(list1)
    ...: list2 = list.sort(list1)
    ...: print(list2)
    ...: list2[0]
[2, 1]
[1, 2]
TypeError                                 Traceback (most recent call last)
/home/frappe/frappe-bench/apps/frappe/frappe/commands/utils.py in <module>()
      5 list2 = list.sort(list1)
      6 print(list2)
----> 7 list2[0]

TypeError: 'NoneType' object is not subscriptable

The error is self-explanatory. You are trying to subscript an object which you think is a list or dict, but actually is None. This means that you tried to do:


This error means that you attempted to index an object that doesn’t have that functionality. You might have noticed that the method sort() that only modify the list have no return value printed – they return the default None. ‘NoneType’ object is not subscriptable is the one thrown by python when you use the square bracket notation object[key] where an object doesn’t define the getitem method . This is a design principle for all mutable data structures in Python.