Fix: attempts to add overrides function
Overrides parent_fieldname in outer form to all child rows's fieldname
This commit is contained in:
parent
6117ac5aff
commit
bffe933c22
@ -291,17 +291,16 @@ $.extend(erpnext.utils, {
|
||||
return options[0];
|
||||
}
|
||||
},
|
||||
copy_parent_value_in_all_row: function(doc, dt, dn, table_fieldname, fieldname, parent_fieldname) {
|
||||
var d = locals[dt][dn];
|
||||
if(d[parent_fieldname]){
|
||||
var cl = doc[table_fieldname] || [];
|
||||
for(var i = 0; i < cl.length; i++) {
|
||||
overrides_parent_value_in_all_rows: function(doc, dt, dn, table_fieldname, fieldname, parent_fieldname) {
|
||||
let d = locals[dt][dn];
|
||||
if(doc[parent_fieldname]){
|
||||
let cl = doc[table_fieldname] || [];
|
||||
for(let i = 0; i < cl.length; i++) {
|
||||
cl[i][fieldname] = doc[parent_fieldname];
|
||||
}
|
||||
frappe.refresh_field(table_fieldname);
|
||||
}
|
||||
refresh_field(table_fieldname);
|
||||
},
|
||||
|
||||
create_new_doc: function (doctype, update_fields) {
|
||||
frappe.model.with_doctype(doctype, function() {
|
||||
var new_doc = frappe.model.get_new_doc(doctype);
|
||||
|
Loading…
Reference in New Issue
Block a user