fix: pass empty string email content of pos invoice #40514
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When complete order in point of sale (Order Summary). When we send invoice email frappe send this error:
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
Traceback (most recent call last):
File "apps/frappe/frappe/app.py", line 95, in application
response = frappe.api.handle()
File "apps/frappe/frappe/api.py", line 54, in handle
return frappe.handler.handle()
File "apps/frappe/frappe/handler.py", line 47, in handle
data = execute_cmd(cmd)
File "apps/frappe/frappe/handler.py", line 85, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File "apps/frappe/frappe/init.py", line 1622, in call
return fn(*args, **newargs)
File "apps/frappe/frappe/core/doctype/communication/email.py", line 79, in make
return _make(
File "apps/frappe/frappe/core/doctype/communication/email.py", line 173, in _make
comm.send_email(
File "apps/frappe/frappe/core/doctype/communication/mixins.py", line 305, in send_email
if input_dict := self.sendmail_input_dict(
File "apps/frappe/frappe/core/doctype/communication/mixins.py", line 284, in sendmail_input_dict
"content": self.get_content(print_format=print_format),
File "apps/frappe/frappe/core/doctype/communication/mixins.py", line 142, in get_content
return self.content + self.get_attach_link(print_format)
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
Request Data
{
"type": "POST",
"args": {
"recipients": "mmdanny89@gmail.com",
"subject": "POS Invoice: ACC-PSINV-2024-00035",
"doctype": "POS Invoice",
"name": "ACC-PSINV-2024-00035",
"send_email": 1,
"print_format": "Invoice Print POS",
"sender_full_name": "Danny Molina",
"_lang": "es"
},
"headers": {},
"error_handlers": {},
"url": "/api/method/frappe.core.doctype.communication.email.make"
}
In view i added empty content for this email.make call this slove the error