Unable to Create New Fixed Asset in both v12 and v13

Hi While creating a new asset we are getting the following error:

Traceback (most recent call last):
  File "apps/frappe/frappe/desk/form/save.py", line 25, in savedocs
    doc.save()
  File "apps/frappe/frappe/model/document.py", line 310, in save
    return self._save(*args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 332, in _save
    return self.insert()
  File "apps/frappe/frappe/model/document.py", line 256, in insert
    self.set_new_name(set_name=set_name, set_child_names=set_child_names)
  File "apps/frappe/frappe/model/document.py", line 464, in set_new_name
    set_new_name(self)
  File "apps/frappe/frappe/model/naming.py", line 46, in set_new_name
    doc.run_method("autoname")
  File "apps/frappe/frappe/model/document.py", line 941, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 1260, in composer
    return composed(self, method, *args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 1242, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "apps/frappe/frappe/model/document.py", line 938, in fn
    return method_object(*args, **kwargs)
TypeError: 'int' object is not callable
request.js:430:14
Traceback (most recent call last):
  File "apps/frappe/frappe/app.py", line 69, in application
    response = frappe.api.handle()
  File "apps/frappe/frappe/api.py", line 55, in handle
    return frappe.handler.handle()
  File "apps/frappe/frappe/handler.py", line 38, in handle
    data = execute_cmd(cmd)
  File "apps/frappe/frappe/handler.py", line 76, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "apps/frappe/frappe/__init__.py", line 1448, in call
    return fn(*args, **newargs)
  File "apps/frappe/frappe/desk/form/save.py", line 25, in savedocs
    doc.save()
  File "apps/frappe/frappe/model/document.py", line 310, in save
    return self._save(*args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 332, in _save
    return self.insert()
  File "apps/frappe/frappe/model/document.py", line 256, in insert
    self.set_new_name(set_name=set_name, set_child_names=set_child_names)
  File "apps/frappe/frappe/model/document.py", line 464, in set_new_name
    set_new_name(self)
  File "apps/frappe/frappe/model/naming.py", line 46, in set_new_name
    doc.run_method("autoname")
  File "apps/frappe/frappe/model/document.py", line 941, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 1260, in composer
    return composed(self, method, *args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 1242, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "apps/frappe/frappe/model/document.py", line 938, in fn
    return method_object(*args, **kwargs)
TypeError: 'int' object is not callable
request.js:430:14

Did you try to run, bench build from your frappe-bench directory?

On my test server I have tried bench --site site_name build but even after that I am getting the same error. This error is coming in both test and production server since last 2~3 months and we are unable to create any new assets.

Seems like a weird error, unable to resolve

I think I found a BUG:

Now in Asset there is a field called “depreciation_method” I think because of which this error is coming and it was introduced in Mar-2022 only.

Refer the json for Asset as well:

And same goes for version-13 as well.

Turns out I had a custom field named autoname in the document ASSET which was creating this error removing that field or renaming has resolved this issue.

1 Like