ERPNext Foundation ERPNext Cloud User Manual Blog Discuss Frappé* Donate

Error on saving custom document after editing doc field


#1

I installed a custom app and created a couple of doctypes under it. Everything was working well till I edited the article field (changed the field name). Now, I get this error whenever I try saving.
I’ve done bench update but the error persists.

Traceback (most recent call last):
File “/srv/bench/erpnext/apps/frappe/frappe/desk/form/save.py”, line 22, in savedocs
doc.save()
File “/srv/bench/erpnext/apps/frappe/frappe/model/document.py”, line 260, in save
return self._save(*args, **kwargs)
File “/srv/bench/erpnext/apps/frappe/frappe/model/document.py”, line 283, in _save
self.insert()
File “/srv/bench/erpnext/apps/frappe/frappe/model/document.py”, line 222, in insert
self.run_before_save_methods()
File “/srv/bench/erpnext/apps/frappe/frappe/model/document.py”, line 876, in run_before_save_methods
self.run_method(“validate”)
File “/srv/bench/erpnext/apps/frappe/frappe/model/document.py”, line 772, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/srv/bench/erpnext/apps/frappe/frappe/model/document.py”, line 1048, in composer
return composed(self, method, *args, **kwargs)
File “/srv/bench/erpnext/apps/frappe/frappe/model/document.py”, line 1031, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/srv/bench/erpnext/apps/frappe/frappe/model/document.py”, line 766, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/srv/bench/erpnext/apps/extensions/extensions/extensions/doctype/library_transaction/library_transaction.py”, line 15, in validate
“article”: self.article,
AttributeError: ‘LibraryTransaction’ object has no attribute ‘article’

Traceback (most recent call last):
File “/srv/bench/erpnext/apps/frappe/frappe/app.py”, line 61, in application
response = frappe.handler.handle()
File “/srv/bench/erpnext/apps/frappe/frappe/handler.py”, line 21, in handle
data = execute_cmd(cmd)
File “/srv/bench/erpnext/apps/frappe/frappe/handler.py”, line 56, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “/srv/bench/erpnext/apps/frappe/frappe/init.py”, line 1032, in call
return fn(*args, **newargs)
File “/srv/bench/erpnext/apps/frappe/frappe/desk/form/save.py”, line 22, in savedocs
doc.save()
File “/srv/bench/erpnext/apps/frappe/frappe/model/document.py”, line 260, in save
return self._save(*args, **kwargs)
File “/srv/bench/erpnext/apps/frappe/frappe/model/document.py”, line 283, in _save
self.insert()
File “/srv/bench/erpnext/apps/frappe/frappe/model/document.py”, line 222, in insert
self.run_before_save_methods()
File “/srv/bench/erpnext/apps/frappe/frappe/model/document.py”, line 876, in run_before_save_methods
self.run_method(“validate”)
File “/srv/bench/erpnext/apps/frappe/frappe/model/document.py”, line 772, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/srv/bench/erpnext/apps/frappe/frappe/model/document.py”, line 1048, in composer
return composed(self, method, *args, **kwargs)
File “/srv/bench/erpnext/apps/frappe/frappe/model/document.py”, line 1031, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/srv/bench/erpnext/apps/frappe/frappe/model/document.py”, line 766, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/srv/bench/erpnext/apps/extensions/extensions/extensions/doctype/library_transaction/library_transaction.py”, line 15, in validate
“article”: self.article,
AttributeError: ‘LibraryTransaction’ object has no attribute ‘article’


#2

There was a conflict with validation. I edited the validation code to accommodate the changes, then I restarted the server.


#3