[minor] fix grid, dependency in quick_entry

This commit is contained in:
Rushabh Mehta 2017-11-13 12:08:14 +05:30
parent 88a3ab3995
commit af8bbd8018
3 changed files with 5 additions and 5 deletions

View file

@ -148,10 +148,8 @@ frappe.ui.form.Control = Class.extend({
return this.get_input_value ?
(this.parse ? this.parse(this.get_input_value()) : this.get_input_value()) :
undefined;
} else if(this.get_status()==='Read') {
return this.value || undefined;
} else {
return undefined;
return this.value || undefined;
}
},
set_model_value: function(value) {

View file

@ -361,7 +361,7 @@ frappe.ui.form.Grid = Class.extend({
},
set_editable_grid_column_disp: function(fieldname, show) {
//Hide columns for editable grids
if (this.meta.editable_grid) {
if (this.meta.editable_grid && this.grid_rows) {
this.grid_rows.forEach(function(row) {
row.columns_list.forEach(function(column) {
//Hide the column specified

View file

@ -38,8 +38,9 @@ frappe.ui.form.QuickEntryForm = Class.extend({
},
set_meta_and_mandatory_fields: function(){
// prepare a list of mandatory and bold fields
this.mandatory = $.map(frappe.get_meta(this.doctype).fields,
function(d) { return (d.reqd || d.bold && !d.read_only) ? d : null; });
function(d) { return (d.reqd || d.bold && !d.read_only) ? $.extend({}, d) : null; });
this.meta = frappe.get_meta(this.doctype);
if (!this.doc) {
this.doc = frappe.model.get_new_doc(this.doctype, null, null, true);
@ -108,6 +109,7 @@ frappe.ui.form.QuickEntryForm = Class.extend({
this.dialog.onhide = () => frappe.quick_entry = null;
this.dialog.show();
this.dialog.refresh_dependency();
this.set_defaults();
if (this.init_callback) {