Merge pull request #17163 from frappe/mergify/bp/develop/pr-17161
fix: Handle case where document title can be NONE (backport #17161)
This commit is contained in:
commit
b1e97c1ff4
2 changed files with 2 additions and 2 deletions
|
|
@ -438,7 +438,7 @@ class Document(BaseDocument):
|
|||
|
||||
def get_title(self):
|
||||
"""Get the document title based on title_field or `title` or `name`"""
|
||||
return self.get(self.meta.get_title_field())
|
||||
return self.get(self.meta.get_title_field()) or ""
|
||||
|
||||
def set_title_field(self):
|
||||
"""Set title field based on template"""
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ def get_context(context):
|
|||
"body": body,
|
||||
"print_style": print_style,
|
||||
"comment": frappe.session.user,
|
||||
"title": frappe.utils.strip_html(doc.get_title()),
|
||||
"title": frappe.utils.strip_html(doc.get_title() or doc.name),
|
||||
"lang": frappe.local.lang,
|
||||
"layout_direction": "rtl" if is_rtl() else "ltr",
|
||||
"doctype": frappe.form_dict.doctype,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue