Whenever we save a quotation, and error is thrown. Following is the trace.
Traceback (most recent call last):
File "/home/ntexadmin/projects/withrun/withrun-bench/apps/frappe/frappe/desk/form/save.py", line 22, in savedocs
doc.save()
File "/home/ntexadmin/projects/withrun/withrun-bench/apps/frappe/frappe/model/document.py", line 230, in save
return self._save(*args, **kwargs)
File "/home/ntexadmin/projects/withrun/withrun-bench/apps/frappe/frappe/model/document.py", line 263, in _save
self.run_before_save_methods()
File "/home/ntexadmin/projects/withrun/withrun-bench/apps/frappe/frappe/model/document.py", line 777, in run_before_save_methods
self.run_method("validate")
File "/home/ntexadmin/projects/withrun/withrun-bench/apps/frappe/frappe/model/document.py", line 671, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File "/home/ntexadmin/projects/withrun/withrun-bench/apps/frappe/frappe/model/document.py", line 892, in composer
return composed(self, method, *args, **kwargs)
File "/home/ntexadmin/projects/withrun/withrun-bench/apps/frappe/frappe/model/document.py", line 875, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File "/home/ntexadmin/projects/withrun/withrun-bench/apps/frappe/frappe/model/document.py", line 665, in <lambda>
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File "/home/ntexadmin/projects/withrun/withrun-bench/apps/erpnext/erpnext/selling/doctype/quotation/quotation.py", line 26, in validate
super(Quotation, self).validate()
File "/home/ntexadmin/projects/withrun/withrun-bench/apps/erpnext/erpnext/controllers/selling_controller.py", line 35, in validate
super(SellingController, self).validate()
File "/home/ntexadmin/projects/withrun/withrun-bench/apps/erpnext/erpnext/controllers/stock_controller.py", line 17, in validate
super(StockController, self).validate()
File "/home/ntexadmin/projects/withrun/withrun-bench/apps/erpnext/erpnext/controllers/accounts_controller.py", line 37, in validate
self.calculate_taxes_and_totals()
File "/home/ntexadmin/projects/withrun/withrun-bench/apps/erpnext/erpnext/controllers/accounts_controller.py", line 88, in calculate_taxes_and_totals
calculate_taxes_and_totals(self)
File "/home/ntexadmin/projects/withrun/withrun-bench/apps/erpnext/erpnext/controllers/taxes_and_totals.py", line 15, in __init__
self.calculate()
File "/home/ntexadmin/projects/withrun/withrun-bench/apps/erpnext/erpnext/controllers/taxes_and_totals.py", line 19, in calculate
self._calculate()
File "/home/ntexadmin/projects/withrun/withrun-bench/apps/erpnext/erpnext/controllers/taxes_and_totals.py", line 38, in _calculate
self.calculate_totals()
File "/home/ntexadmin/projects/withrun/withrun-bench/apps/erpnext/erpnext/controllers/taxes_and_totals.py", line 303, in calculate_totals
self._set_in_company_currency(self.doc, ["total_taxes_and_charges", "rounding_adjustment"])
File "/home/ntexadmin/projects/withrun/withrun-bench/apps/erpnext/erpnext/controllers/taxes_and_totals.py", 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/ntexadmin/projects/withrun/withrun-bench/apps/frappe/frappe/model/base_document.py", line 692, in precision
if df.fieldtype in ("Currency", "Float", "Percent"):
AttributeError: 'NoneType' object has no attribute 'fieldtype'
Traceback (most recent call last):
File "/home/ntexadmin/projects/withrun/withrun-bench/apps/frappe/frappe/app.py", line 57, in application
response = frappe.handler.handle()
File "/home/ntexadmin/projects/withrun/withrun-bench/apps/frappe/frappe/handler.py", line 22, in handle
data = execute_cmd(cmd)
File "/home/ntexadmin/projects/withrun/withrun-bench/apps/frappe/frappe/handler.py", line 53, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File "/home/ntexadmin/projects/withrun/withrun-bench/apps/frappe/frappe/__init__.py", line 923, in call
return fn(*args, **newargs)
File "/home/ntexadmin/projects/withrun/withrun-bench/apps/frappe/frappe/desk/form/save.py", line 22, in savedocs
doc.save()
File "/home/ntexadmin/projects/withrun/withrun-bench/apps/frappe/frappe/model/document.py", line 230, in save
return self._save(*args, **kwargs)
File "/home/ntexadmin/projects/withrun/withrun-bench/apps/frappe/frappe/model/document.py", line 263, in _save
self.run_before_save_methods()
File "/home/ntexadmin/projects/withrun/withrun-bench/apps/frappe/frappe/model/document.py", line 777, in run_before_save_methods
self.run_method("validate")
File "/home/ntexadmin/projects/withrun/withrun-bench/apps/frappe/frappe/model/document.py", line 671, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File "/home/ntexadmin/projects/withrun/withrun-bench/apps/frappe/frappe/model/document.py", line 892, in composer
return composed(self, method, *args, **kwargs)
File "/home/ntexadmin/projects/withrun/withrun-bench/apps/frappe/frappe/model/document.py", line 875, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File "/home/ntexadmin/projects/withrun/withrun-bench/apps/frappe/frappe/model/document.py", line 665, in <lambda>
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File "/home/ntexadmin/projects/withrun/withrun-bench/apps/erpnext/erpnext/selling/doctype/quotation/quotation.py", line 26, in validate
super(Quotation, self).validate()
File "/home/ntexadmin/projects/withrun/withrun-bench/apps/erpnext/erpnext/controllers/selling_controller.py", line 35, in validate
super(SellingController, self).validate()
File "/home/ntexadmin/projects/withrun/withrun-bench/apps/erpnext/erpnext/controllers/stock_controller.py", line 17, in validate
super(StockController, self).validate()
File "/home/ntexadmin/projects/withrun/withrun-bench/apps/erpnext/erpnext/controllers/accounts_controller.py", line 37, in validate
self.calculate_taxes_and_totals()
File "/home/ntexadmin/projects/withrun/withrun-bench/apps/erpnext/erpnext/controllers/accounts_controller.py", line 88, in calculate_taxes_and_totals
calculate_taxes_and_totals(self)
File "/home/ntexadmin/projects/withrun/withrun-bench/apps/erpnext/erpnext/controllers/taxes_and_totals.py", line 15, in __init__
self.calculate()
File "/home/ntexadmin/projects/withrun/withrun-bench/apps/erpnext/erpnext/controllers/taxes_and_totals.py", line 19, in calculate
self._calculate()
File "/home/ntexadmin/projects/withrun/withrun-bench/apps/erpnext/erpnext/controllers/taxes_and_totals.py", line 38, in _calculate
self.calculate_totals()
File "/home/ntexadmin/projects/withrun/withrun-bench/apps/erpnext/erpnext/controllers/taxes_and_totals.py", line 303, in calculate_totals
self._set_in_company_currency(self.doc, ["total_taxes_and_charges", "rounding_adjustment"])
File "/home/ntexadmin/projects/withrun/withrun-bench/apps/erpnext/erpnext/controllers/taxes_and_totals.py", 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/ntexadmin/projects/withrun/withrun-bench/apps/frappe/frappe/model/base_document.py", line 692, in precision
if df.fieldtype in ("Currency", "Float", "Percent"):
AttributeError: 'NoneType' object has no attribute 'fieldtype'
Error basically starts from here as rounding_adjustment field is sent, while it is not present. self._set_in_company_currency(self.doc, [“total_taxes_and_charges”, “rounding_adjustment”])
changing this to
self._set_in_company_currency(self.doc, [“total_taxes_and_charges”])
temporarily solves the error.
Versions:
erpnext 8.11.4
frappe 8.10.8
bench 4.1.0
Last commit:
commit 6960a76adc30277d598bf693b7e0f81b6dd918aa
Author: Nabin Hait nabinhait@gmail.com
Date: Tue Sep 19 17:22:30 2017 +0530
Fixes related to schools fees