AttributeError: 'NoneType' object has no attribute 'fieldtype' in Sales and Purchase Invoice

Hi all, this is my first time posting anything so I must say thanks to all involved with the system. It is really a great product you have here.

I have installed a couple of instances of ErpNext on different machines but have never come up with this error, however today I installed a new ErpNext instance on a machine with another instance running, everything went well enough except on the new installtion whenever I try to create a Sales or Purchase Invoice I get this error.

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

Here is the full errror:
Traceback (most recent call last):
File “/home/aisenyi/frappe-bench-pos/apps/frappe/frappe/”, line 57, in application
response = frappe.handler.handle()
File “/home/aisenyi/frappe-bench-pos/apps/frappe/frappe/”, line 22, in handle
data = execute_cmd(cmd)
File “/home/aisenyi/frappe-bench-pos/apps/frappe/frappe/”, line 53, in execute_cmd
return, **frappe.form_dict)
File “/home/aisenyi/frappe-bench-pos/apps/frappe/frappe/”, line 923, in call
return fn(*args, **newargs)
File “/home/aisenyi/frappe-bench-pos/apps/frappe/frappe/desk/form/”, line 22, in savedocs
File “/home/aisenyi/frappe-bench-pos/apps/frappe/frappe/model/”, line 230, in save
return self._save(*args, **kwargs)
File “/home/aisenyi/frappe-bench-pos/apps/frappe/frappe/model/”, line 253, in _save
File “/home/aisenyi/frappe-bench-pos/apps/frappe/frappe/model/”, line 192, in insert
File “/home/aisenyi/frappe-bench-pos/apps/frappe/frappe/model/”, line 772, in run_before_save_methods
File “/home/aisenyi/frappe-bench-pos/apps/frappe/frappe/model/”, line 666, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/aisenyi/frappe-bench-pos/apps/frappe/frappe/model/”, line 887, in composer
return composed(self, method, *args, **kwargs)
File “/home/aisenyi/frappe-bench-pos/apps/frappe/frappe/model/”, line 870, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/aisenyi/frappe-bench-pos/apps/frappe/frappe/model/”, line 660, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/aisenyi/frappe-bench-pos/apps/erpnext/erpnext/accounts/doctype/purchase_invoice/”, line 45, in validate
super(PurchaseInvoice, self).validate()
File “/home/aisenyi/frappe-bench-pos/apps/erpnext/erpnext/controllers/”, line 31, in validate
super(BuyingController, self).validate()
File “/home/aisenyi/frappe-bench-pos/apps/erpnext/erpnext/controllers/”, line 17, in validate
super(StockController, self).validate()
File “/home/aisenyi/frappe-bench-pos/apps/erpnext/erpnext/controllers/”, line 37, in validate
File “/home/aisenyi/frappe-bench-pos/apps/erpnext/erpnext/controllers/”, line 88, in calculate_taxes_and_totals
File “/home/aisenyi/frappe-bench-pos/apps/erpnext/erpnext/controllers/”, line 15, in init
File “/home/aisenyi/frappe-bench-pos/apps/erpnext/erpnext/controllers/”, line 19, in calculate
File “/home/aisenyi/frappe-bench-pos/apps/erpnext/erpnext/controllers/”, line 38, in _calculate
File “/home/aisenyi/frappe-bench-pos/apps/erpnext/erpnext/controllers/”, line 303, in calculate_totals
self._set_in_company_currency(self.doc, [“total_taxes_and_charges”, “rounding_adjustment”])
File “/home/aisenyi/frappe-bench-pos/apps/erpnext/erpnext/controllers/”, line 81, in set_in_company_currency
val = flt(flt(doc.get(f), doc.precision(f)) * self.doc.conversion_rate, doc.precision("base
" + f))
File “/home/aisenyi/frappe-bench-pos/apps/frappe/frappe/model/”, line 692, in precision
if df.fieldtype in (“Currency”, “Float”, “Percent”):
AttributeError: ‘NoneType’ object has no attribute ‘fieldtype’

Could anybody help?

Seems like there are no fields called "base_total_taxes_and_charges” or “base_rounding_adjustment” in Sales Invoice doctype. Can you confirm?

If that is the case, try to execute bench reload-doc accounts doctype sales_invoice from frappe-bench directory.


Hi, thanks for the reply. This issue was fixed with a simple update. Not really sure what the problem was but on my next update it fixed itself. Thanks.