TypeError: sendmail() got an unexpected keyword argument 'bulk'

Hi guys,

We face the weird error on our Development server. It hosts the latest ERPNext 7.0.34 there but we started to observe it at least since ERPNext 7.0.18 was there.

The call stack is listed in P.S. below (please note the line at the very bottom is in our custom application’s .py code module). This functionality worked quite well on ERP Next 6.x.x codebases (for several months in fact :slight_smile:)

When implementing the functionality of email notifications in our custom app code, we reused the similar code from the standard Support module available in the basic configuration of ERP Next.

We observed the separate post dedicated to the issues with the outbound email notifications from Support module (see ERPNext 7: Email not going out of support module. Email works well on other modules) but it looks like our problem could be different.

@rmehta: could you please suggest the best way to work it around?

Thanks in advance.

indent preformatted text by 4 spaces
P.S. Error Report

Traceback (most recent call last):
File “/home/zwebmaster/frappe-bench/apps/frappe/frappe/app.py”, line 55, in application
response = frappe.handler.handle()
File “/home/zwebmaster/frappe-bench/apps/frappe/frappe/handler.py”, line 19, in handle
File “/home/zwebmaster/frappe-bench/apps/frappe/frappe/handler.py”, line 36, in execute_cmd
ret = frappe.call(method, **frappe.form_dict)
File “/home/zwebmaster/frappe-bench/apps/frappe/frappe/init.py”, line 879, in call
return fn(*args, **newargs)
File “/home/zwebmaster/frappe-bench/apps/frappe/frappe/handler.py”, line 67, in runserverobj
frappe.desk.form.run_method.runserverobj(method, docs=docs, dt=dt, dn=dn, arg=arg, args=args)
File “/home/zwebmaster/frappe-bench/apps/frappe/frappe/desk/form/run_method.py”, line 35, in runserverobj
r = doc.run_method(method)
File “/home/zwebmaster/frappe-bench/apps/frappe/frappe/model/document.py”, line 661, in run_method
return Document.hook(fn)(self, *args, **kwargs)
File “/home/zwebmaster/frappe-bench/apps/frappe/frappe/model/document.py”, line 839, in composer
return composed(self, method, *args, **kwargs)
File “/home/zwebmaster/frappe-bench/apps/frappe/frappe/model/document.py”, line 822, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/zwebmaster/frappe-bench/apps/frappe/frappe/model/document.py”, line 655, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/zwebmaster/frappe-bench/apps/warranty_management/warranty_management/warranty_management/doctype/warranty_request/warranty_request.py”, line 134, in start_repairing_item
TypeError: sendmail() got an unexpected keyword argument ‘bulk’
indent preformatted text by 4 spaces

So, the problem is that your custom app is using the sendmail function, and the function has been changed since 6.x.x, it no longer takes the bulk parameter. Just fix the code at bench/apps/warranty_management/warranty_management/warranty_management/doctype/warranty_request/warranty_request.py", line 134, in start_repairing_item bulk=True)

@vjFaLk: thanks for the clue We will go ahead with the solution proposed, and I will update this thread once we confirm the resolution.

Thank you once again.

@vjFaLk: the fix you suggested works well on our end. Thank you once again.

1 Like

how u have solved bulk perimeter ?

1 Like