Skip to content

Commit

Permalink
fix: Check if df.options exists before setting docfields
Browse files Browse the repository at this point in the history
Fixes: #12793
  • Loading branch information
surajshetty3416 committed Apr 4, 2021
1 parent 1767d87 commit a71066f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion frappe/public/js/frappe/form/grid_row.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default class GridRow {
this.on_grid_fields_dict = {};
this.on_grid_fields = [];
$.extend(this, opts);
if (this.doc) {
if (this.doc && this.parent_df.options) {
this.docfields = frappe.meta.get_docfields(this.parent_df.options, this.doc.name);
}
this.columns = {};
Expand Down Expand Up @@ -255,6 +255,7 @@ export default class GridRow {
this.grid.visible_columns.forEach((col, ci) => {
// to get update df for the row
let df = this.docfields.find(field => field.fieldname === col[0].fieldname);

let colsize = col[1];
let txt = this.doc ?
frappe.format(this.doc[df.fieldname], df, null, this.doc) :
Expand Down

0 comments on commit a71066f

Please sign in to comment.