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

AttributeError: 'Quotation' object has no attribute 'customer'

bug

#1

This is new, I updated today to 11.1.18 and now I have the error above

Traceback (most recent call last):
` File “/home/tony/frappe-bench/apps/frappe/frappe/desk/form/save.py”, line 22, in savedocs
doc.save()
File “/home/tony/frappe-bench/apps/frappe/frappe/model/document.py”, line 260, in save
return self._save(*args, **kwargs)
File “/home/tony/frappe-bench/apps/frappe/frappe/model/document.py”, line 283, in _save
self.insert()
File “/home/tony/frappe-bench/apps/frappe/frappe/model/document.py”, line 222, in insert
self.run_before_save_methods()
File “/home/tony/frappe-bench/apps/frappe/frappe/model/document.py”, line 876, in run_before_save_methods
self.run_method(“validate”)
File “/home/tony/frappe-bench/apps/frappe/frappe/model/document.py”, line 772, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/tony/frappe-bench/apps/frappe/frappe/model/document.py”, line 1048, in composer
return composed(self, method, *args, **kwargs)
File “/home/tony/frappe-bench/apps/frappe/frappe/model/document.py”, line 1031, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/tony/frappe-bench/apps/frappe/frappe/model/document.py”, line 766, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/tony/frappe-bench/apps/erpnext/erpnext/selling/doctype/quotation/quotation.py”, line 31, in validate
self.validate_valid_till()
File “/home/tony/frappe-bench/apps/erpnext/erpnext/selling/doctype/quotation/quotation.py”, line 47, in validate_quotation_to
if self.quotation_to == “Lead” and self.party_name:
AttributeError: ‘Quotation’ object has no attribute ‘customer’

Traceback (most recent call last):
File “/home/tony/frappe-bench/apps/frappe/frappe/app.py”, line 61, in application
response = frappe.handler.handle()
File “/home/tony/frappe-bench/apps/frappe/frappe/handler.py”, line 21, in handle
data = execute_cmd(cmd)
File “/home/tony/frappe-bench/apps/frappe/frappe/handler.py”, line 56, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “/home/tony/frappe-bench/apps/frappe/frappe/init.py”, line 1027, in call
if isinstance(fn, string_types):
File “/home/tony/frappe-bench/apps/frappe/frappe/desk/form/save.py”, line 22, in savedocs
doc.save()
File “/home/tony/frappe-bench/apps/frappe/frappe/model/document.py”, line 260, in save
return self._save(*args, **kwargs)
File “/home/tony/frappe-bench/apps/frappe/frappe/model/document.py”, line 283, in _save
self.insert()
File “/home/tony/frappe-bench/apps/frappe/frappe/model/document.py”, line 222, in insert
self.run_before_save_methods()
File “/home/tony/frappe-bench/apps/frappe/frappe/model/document.py”, line 876, in run_before_save_methods
self.run_method(“validate”)
File “/home/tony/frappe-bench/apps/frappe/frappe/model/document.py”, line 772, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/tony/frappe-bench/apps/frappe/frappe/model/document.py”, line 1048, in composer
return composed(self, method, *args, **kwargs)
File “/home/tony/frappe-bench/apps/frappe/frappe/model/document.py”, line 1031, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/tony/frappe-bench/apps/frappe/frappe/model/document.py”, line 766, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/tony/frappe-bench/apps/erpnext/erpnext/selling/doctype/quotation/quotation.py”, line 31, in validate
self.validate_valid_till()
File “/home/tony/frappe-bench/apps/erpnext/erpnext/selling/doctype/quotation/quotation.py”, line 47, in validate_quotation_to
if self.quotation_to == “Lead” and self.party_name:
AttributeError: ‘Quotation’ object has no attribute ‘customer’`


#2

It has been fixed in the latest version, please update.


#3

I still have this error after updating


#4

I also have a similar issue with payroll now. Can somebody please help?


#5

Explain the issue regarding the payroll.


#6

This has been reported several times by my colleague:

AttributeError: ‘SalaryDetail’ object has no attribute 'depends_on_lwp

Best Regards,


#7

Am I the only person with this problem, I still have this and I still cannot generate quotations.


#8

Hmm, it looks like the patch written to handle renaming on field depends_on_lwp was not executed on your ERPNext instance.

Try executing bench update and see if the patch gets executed.

If above doesn’t work, you might have to delete the patch log from the database (bench mariadb) by executing following SQL query:

delete from `tabPatch Log` where patch like '%rename_depends_on_lwp%';

After executing above SQL query, run bench update --patch.


#9

does this address both the:
AttributeError: ‘Quotation’ object has no attribute ‘customer’`
and
AttributeError: ‘SalaryDetail’ object has no attribute ‘depends_on_lwp’
?


#10

Also is there a log where I can find possible errors like this…


#11

For the error relating to quotation, try executing the following code in the bench console:

frappe.reload_doc('selling', 'doctype', 'quotation', force=1)
frappe.db.commit()