Merge pull request #12940 from surajshetty3416/fix-grid-docfields
fix: Use grid docfield list while creating grid_row docfield copy
This commit is contained in:
commit
0ab545b2b0
2 changed files with 3 additions and 2 deletions
|
|
@ -6,6 +6,7 @@ export default class GridRow {
|
|||
this.on_grid_fields = [];
|
||||
$.extend(this, opts);
|
||||
if (this.doc && this.parent_df.options) {
|
||||
frappe.meta.make_docfield_copy_for(this.parent_df.options, this.doc.name, this.docfields);
|
||||
this.docfields = frappe.meta.get_docfields(this.parent_df.options, this.doc.name);
|
||||
}
|
||||
this.columns = {};
|
||||
|
|
|
|||
|
|
@ -38,14 +38,14 @@ $.extend(frappe.meta, {
|
|||
frappe.meta.docfield_list[df.parent].push(df);
|
||||
},
|
||||
|
||||
make_docfield_copy_for: function(doctype, docname) {
|
||||
make_docfield_copy_for: function(doctype, docname, docfield_list=null) {
|
||||
var c = frappe.meta.docfield_copy;
|
||||
if(!c[doctype])
|
||||
c[doctype] = {};
|
||||
if(!c[doctype][docname])
|
||||
c[doctype][docname] = {};
|
||||
|
||||
var docfield_list = frappe.meta.docfield_list[doctype] || [];
|
||||
docfield_list = docfield_list || frappe.meta.docfield_list[doctype] || [];
|
||||
for(var i=0, j=docfield_list.length; i<j; i++) {
|
||||
var df = docfield_list[i];
|
||||
c[doctype][docname][df.fieldname || df.label] = copy_dict(df);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue