fix: set doctype and name in docinfo (#18088)
This commit is contained in:
parent
2866069eb4
commit
627302d851
2 changed files with 6 additions and 9 deletions
|
|
@ -110,6 +110,8 @@ def get_docinfo(doc=None, doctype=None, name=None):
|
|||
|
||||
docinfo.update(
|
||||
{
|
||||
"doctype": doc.doctype,
|
||||
"name": doc.name,
|
||||
"attachments": get_attachments(doc.doctype, doc.name),
|
||||
"communications": communications_except_auto_messages,
|
||||
"automated_messages": automated_messages,
|
||||
|
|
|
|||
|
|
@ -56,16 +56,11 @@ Object.assign(frappe.model, {
|
|||
sync_docinfo: (r) => {
|
||||
// set docinfo (comments, assign, attachments)
|
||||
if (r.docinfo) {
|
||||
var doc;
|
||||
if (r.docs) {
|
||||
doc = r.docs[0];
|
||||
} else {
|
||||
if (cur_frm) doc = cur_frm.doc;
|
||||
}
|
||||
if (doc) {
|
||||
if (!frappe.model.docinfo[doc.doctype]) frappe.model.docinfo[doc.doctype] = {};
|
||||
frappe.model.docinfo[doc.doctype][doc.name] = r.docinfo;
|
||||
const { doctype, name } = r.docinfo;
|
||||
if (!frappe.model.docinfo[doctype]) {
|
||||
frappe.model.docinfo[doctype] = {};
|
||||
}
|
||||
frappe.model.docinfo[doctype][name] = r.docinfo;
|
||||
|
||||
// copy values to frappe.boot.user_info
|
||||
Object.assign(frappe.boot.user_info, r.docinfo.user_info);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue