Przeglądaj źródła

fix: set `doctype` and `name` in docinfo (#18088) (#18092)

(cherry picked from commit 627302d851)

Co-authored-by: Sagar Vora <sagar@resilient.tech>
version-14
mergify[bot] 2 lat temu
committed by GitHub
rodzic
commit
46f9e09deb
Nie znaleziono w bazie danych klucza dla tego podpisu ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 6 dodań i 9 usunięć
  1. +2
    -0
      frappe/desk/form/load.py
  2. +4
    -9
      frappe/public/js/frappe/model/sync.js

+ 2
- 0
frappe/desk/form/load.py Wyświetl plik

@@ -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,


+ 4
- 9
frappe/public/js/frappe/model/sync.js Wyświetl plik

@@ -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);


Ładowanie…
Anuluj
Zapisz