Error on Saving quotation "server error AttributeError: 'NoneType' object has no attribute 'field type'

Continue here, this duplicate parallel thread of yours here

Hi. Is this correct that you were

hi, i was able to found that this error is occurring due to the Sales Taxes and Charges are added. if i am not adding this Sales Taxes and Charges, there is no error occurring. This problem is not only in the quotation portion, but also in the invoice window also. So i guess this is due to some additional field in the Sales Taxes and Charges window. could you please guide me to fix this issue.

To copy and paste the complete traceback here will help resolve the field in question thanks

JayRam’s excellent suggestion (to debug of the client side) is worth a try too Not able to save Sales Invoice - #3 by JayRam

Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/doctype/sales_invoice/pos.py”, line 597, in submit_invoice
si_doc.insert()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 230, in insert
self.run_before_save_methods()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 893, in run_before_save_methods
self.run_method(“validate”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 794, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 1064, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 1047, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 788, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/doctype/sales_invoice/sales_invoice.py”, line 74, in validate
super(SalesInvoice, self).validate()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/selling_controller.py”, line 39, in validate
super(SellingController, self).validate()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/stock_controller.py”, line 21, in validate
super(StockController, self).validate()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/accounts_controller.py”, line 76, in validate
self.calculate_taxes_and_totals()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/accounts_controller.py”, line 179, in calculate_taxes_and_totals
calculate_taxes_and_totals(self)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/taxes_and_totals.py”, line 16, in init
self.calculate()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/taxes_and_totals.py”, line 33, in calculate
self.set_item_wise_tax_breakup()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/taxes_and_totals.py”, line 615, in set_item_wise_tax_breakup
self.doc.other_charges_calculation = get_itemised_tax_breakup_html(self.doc)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/taxes_and_totals.py”, line 637, in get_itemised_tax_breakup_html
update_itemised_tax_data(doc)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/init.py”, line 129, in caller
return frappe.get_attr(regional_overrides[region][fn_name])(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/regional/united_arab_emirates/utils.py”, line 17, in update_itemised_tax_data
row.total_amount = flt((row.net_amount + row.tax_amount), row.precision(“total_amount”))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 713, in precision
if df.fieldtype in (“Currency”, “Float”, “Percent”):
AttributeError: ‘NoneType’ object has no attribute ‘fieldtype’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/doctype/sales_invoice/pos.py”, line 619, in save_invoice
si.insert(ignore_permissions=True)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 230, in insert
self.run_before_save_methods()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 893, in run_before_save_methods
self.run_method(“validate”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 794, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 1064, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 1047, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 788, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/doctype/sales_invoice/sales_invoice.py”, line 74, in validate
super(SalesInvoice, self).validate()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/selling_controller.py”, line 39, in validate
super(SellingController, self).validate()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/stock_controller.py”, line 21, in validate
super(StockController, self).validate()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/accounts_controller.py”, line 76, in validate
self.calculate_taxes_and_totals()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/accounts_controller.py”, line 179, in calculate_taxes_and_totals
calculate_taxes_and_totals(self)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/taxes_and_totals.py”, line 16, in init
self.calculate()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/taxes_and_totals.py”, line 33, in calculate
self.set_item_wise_tax_breakup()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/taxes_and_totals.py”, line 615, in set_item_wise_tax_breakup
self.doc.other_charges_calculation = get_itemised_tax_breakup_html(self.doc)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/taxes_and_totals.py”, line 637, in get_itemised_tax_breakup_html
update_itemised_tax_data(doc)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/init.py”, line 129, in caller
return frappe.get_attr(regional_overrides[region][fn_name])(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/regional/united_arab_emirates/utils.py”, line 17, in update_itemised_tax_data
row.total_amount = flt((row.net_amount + row.tax_amount), row.precision(“total_amount”))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 713, in precision
if df.fieldtype in (“Currency”, “Float”, “Percent”):
AttributeError: ‘NoneType’ object has no attribute ‘fieldtype’

hi, this is the error log i found inside settings. but for quotation window error i couldn’t find the error log…

This may be a language translation issue - to debug on the client would help shed light what is amiss

hi, i did nt understand the solution that you have mentioned.

Try this advice here Error when saving with tax charges - #2 by Imran_Feroze

Hi, i have done the same process… but still i have the same error when trying to include the TAX charges.

how u solved this

This problem is still not resolved. But, i guess it is because of two currency in one company profile. I have ones solved this issue, but another application error pop-up. so i gave up on this program…

do u remember how u solved this .

AttributeError means that there was an Error that had to do with an Attribute request. In general, when you write x.y, y is the purported attribute of x. NoneType means that instead of an instance of whatever Class or Object you think you’re working with, you’ve actually got None. That usually means that an assignment or function call up failed or returned an unexpected result.

mylist = mylist.sort()

The sort() method of a list sorts the list in-place, that is, mylist is modified. But the actual return value of the method is None and not the list sorted. So you’ve just assigned None to mylist. If you next try to do, say, mylist.append(1) Python will give you this error.

1 Like

@mithun Just checking back in on this, in case you’ve not figured it out. One thing you will want to check is your pricing rules. I ran into this issue with a particular customer record that I had created a custom pricing rule on. The rule was set to “Apply On” “Item Code”, however, I had not defined the specific item-code. So the error I was getting, only happened for that specific client, which lead me to look at the pricing rule I had created.

I see you feel this is related to Sales Tax, so depending on what you’re doing there, you may need to create a sales tax template, if one does not exist.

So, a few questions:

  1. Does the error only happen with specific customers? Or all of them?
  2. Do you have a default sales tax template? If so, can you post the settings here?
  3. Do you have any pricing rules configured? If so, can you post it/them here?

@njb and dear all, I recently installed ERPNext and I’ve the same error when saving quotations. This error is occurring when the Sales Taxes and Charges (Sales Taxes and Charges Template) are added to the quotation.

  1. This happens to all of the customers
  2. I have a default tax template (please see the details below)
  3. No pricing rules configured

Any suggestions?

Has the problem resolved? If yes, can you send me the details?

@riyasudheen.mohammed would you be able to post the the output of the console log?