Information about bug
I am trying to add Date Worked
Date field to the Timesheet Detail doctype and it keeps giving this error because of the hours
float field.
I do not get this error when I updated any existing fields ONLY when i try to add a new field to the this doctype.
Module
projects
Version
Frappe - 15.70.0
ERPNext - 15.65.1
Installation method
docker
Relevant log output / Stack trace / Full Error Message.
Traceback (most recent call last):
File "apps/frappe/frappe/app.py", line 115, in application
response = frappe.api.handle(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/api/__init__.py", line 49, in handle
data = endpoint(**arguments)
^^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/api/v1.py", line 36, in handle_rpc_call
return frappe.handler.handle()
^^^^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/handler.py", line 51, in handle
data = execute_cmd(cmd)
^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/handler.py", line 84, in execute_cmd
return frappe.call(method, **frappe.form_dict)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/__init__.py", line 1751, in call
return fn(*args, **newargs)
^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/handler.py", line 334, in run_doc_method
response = doc.run_method(method)
^^^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/model/document.py", line 1007, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/model/document.py", line 1367, in composer
return composed(self, method, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/model/document.py", line 1349, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
^^^^^^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/model/document.py", line 1004, in fn
return method_object(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/utils/typing_validations.py", line 31, in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/custom/doctype/customize_form/customize_form.py", line 231, in save_customization
self.update_custom_fields()
File "apps/frappe/frappe/custom/doctype/customize_form/customize_form.py", line 461, in update_custom_fields
self.add_custom_field(df, i)
File "apps/frappe/frappe/custom/doctype/customize_form/customize_form.py", line 480, in add_custom_field
d.insert()
File "apps/frappe/frappe/model/document.py", line 334, in insert
self.run_post_save_methods()
File "apps/frappe/frappe/model/document.py", line 1173, in run_post_save_methods
self.run_method("on_update")
File "apps/frappe/frappe/model/document.py", line 1007, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/model/document.py", line 1367, in composer
return composed(self, method, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/model/document.py", line 1349, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
^^^^^^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/model/document.py", line 1004, in fn
return method_object(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/custom/doctype/custom_field/custom_field.py", line 213, in on_update
frappe.db.updatedb(self.dt)
File "apps/frappe/frappe/database/mariadb/database.py", line 463, in updatedb
db_table.sync()
File "apps/frappe/frappe/database/schema.py", line 46, in sync
self.alter()
File "apps/frappe/frappe/database/mariadb/schema.py", line 67, in alter
col.build_for_alter_table(self.current_columns.get(col.fieldname.lower()))
File "apps/frappe/frappe/database/schema.py", line 244, in build_for_alter_table
self.default_changed(current_def)
File "apps/frappe/frappe/database/schema.py", line 259, in default_changed
return self.default_changed_for_decimal(current_def)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/database/schema.py", line 299, in default_changed_for_decimal
return float(current_def["default"]) != float(self.default)
^^^^^^^^^^^^^^^^^^^
ValueError: could not convert string to float: 'hours'