Error in Sales Invoice Saving

Hi,
I have an error when I try to confirm a draft Sales Invoice.

Immagine

Anything can tell me where I can find the server log?

Thanks
Alessandro

Press F12 to open browser console. Copy that traceback and paste it here

This si the error shown in the console:

Blockquote
Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/save.py”, line 19, in savedocs
doc.submit()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 848, in submit
self._submit()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 837, in _submit
self.save()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 260, in save
return self._save(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 313, in _save
self.run_post_save_methods()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 908, in run_post_save_methods
self.run_method(“on_submit”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 772, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 1048, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 1033, in runner
add_to_return_value(self, f(self, method, *args, **kwargs))
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/regional/italy/utils.py”, line 275, in sales_invoice_on_submit
prepare_and_attach_invoice(doc)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/regional/italy/utils.py”, line 281, in prepare_and_attach_invoice
invoice_xml = frappe.render_template(‘erpnext/regional/italy/e-invoice.xml’, context={“doc”: invoice}, is_path=True)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/jinja.py”, line 72, in render_template
return get_jenv().get_template(template).render(context)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/jinja2/environment.py”, line 1008, in render
return self.environment.handle_exception(exc_info, True)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/jinja2/environment.py”, line 780, in handle_exception
reraise(exc_type, exc_value, tb)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/./regional/italy/e-invoice.xml”, line 202, in top-level template code
{{ doc.vat_collectability.split("-")[0] }}
UndefinedError: ‘None’ has no attribute ‘split’
request.js:322 Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/app.py”, line 61, in application
response = frappe.handler.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 21, in handle
data = execute_cmd(cmd)
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 56, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1027, in call
return fn(*args, **newargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/save.py”, line 19, in savedocs
doc.submit()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 848, in submit
self._submit()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 837, in _submit
self.save()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 260, in save
return self._save(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 313, in _save
self.run_post_save_methods()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 908, in run_post_save_methods
self.run_method(“on_submit”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 772, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 1048, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 1033, in runner
add_to_return_value(self, f(self, method, *args, **kwargs))
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/regional/italy/utils.py”, line 275, in sales_invoice_on_submit
prepare_and_attach_invoice(doc)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/regional/italy/utils.py”, line 281, in prepare_and_attach_invoice
invoice_xml = frappe.render_template(‘erpnext/regional/italy/e-invoice.xml’, context={“doc”: invoice}, is_path=True)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/jinja.py”, line 72, in render_template
return get_jenv().get_template(template).render(context)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/jinja2/environment.py”, line 1008, in render
return self.environment.handle_exception(exc_info, True)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/jinja2/environment.py”, line 780, in handle_exception
reraise(exc_type, exc_value, tb)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/./regional/italy/e-invoice.xml”, line 202, in top-level template code
{{ doc.vat_collectability.split("-")[0] }}
UndefinedError: ‘None’ has no attribute ‘split’
request.js:254 Unable to handle failed response
request.js:255 SyntaxError: Unexpected token u in JSON at position 0
at JSON.parse ()
at Object.frappe.request.report_error (request.js:378)
at 500 (request.js:173)
at Object. (request.js:248)
at i (jquery.min.js:2)
at Object.fireWith [as rejectWith] (jquery.min.js:2)
at z (jquery.min.js:4)
at XMLHttpRequest. (jquery.min.js:4)

Thanks
Alessandro

This line in an xml is causing the error. If this is not a required field and is causing problem after an update, create an issue on github