Unable to save DocType - ValueError: could not convert string to float: ''

Hi, I am running V13 and have a new DocType which I made some changes in the DB directly and then made changes from Customization for a field set from data to currency. There are around 20 fields in the form which are of different types. The problem is when I save the form/Customizations I get the error

Traceback (most recent call last):
  File "/home/frappe/frappe-bench/apps/frappe/frappe/app.py", line 68, in application
    response = frappe.api.handle()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/api.py", line 55, in handle
    return frappe.handler.handle()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 31, in handle
    data = execute_cmd(cmd)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 67, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 1172, in call
    return fn(*args, **newargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 234, in run_doc_method
    response = doc.run_method(method)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 861, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 1153, in composer
    return composed(self, method, *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 1136, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 855, in <lambda>
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/custom/doctype/customize_form/customize_form.py", line 151, in save_customization
    frappe.db.updatedb(self.doc_type)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/database/mariadb/database.py", line 282, in updatedb
    db_table.sync()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/database/schema.py", line 40, in sync
    self.alter()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/database/mariadb/schema.py", line 41, in alter
    col.build_for_alter_table(self.current_columns.get(col.fieldname.lower()))
  File "/home/frappe/frappe-bench/apps/frappe/frappe/database/schema.py", line 222, in build_for_alter_table
    if (self.default_changed(current_def)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/database/schema.py", line 239, in default_changed
    return self.default_changed_for_decimal(current_def)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/database/schema.py", line 279, in default_changed_for_decimal
    return float(current_def['default'])!=float(self.default)
ValueError: could not convert string to float: ''

and I can’t seem to be able to figure out which field it is frappe is trying to modify or sync from the DB because this line

ValueError: could not convert string to float: ''

is empty. I tried truncate and drop the table and recreated from bench migrate but even then when I try to save the customization or the DocType I get this error. Any pointers on how to get this resolved or what’s causing this issue?

Thanks.

Hi, were you able to solve this issue? I am facing a similar issue.

Hi, I have a similar problem too when trying to customise a doctype, I get:

ValueError: could not convert string to float: ‘NULL’

Any ideas?

Thanks.