From a71066f3a42f0888e967f51e44886f7db9c4dd8f Mon Sep 17 00:00:00 2001 From: Suraj Shetty Date: Sun, 4 Apr 2021 10:12:10 +0530 Subject: [PATCH] fix: Check if df.options exists before setting docfields Fixes: https://github.com/frappe/frappe/issues/12793 --- frappe/public/js/frappe/form/grid_row.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frappe/public/js/frappe/form/grid_row.js b/frappe/public/js/frappe/form/grid_row.js index bebf46e93d..5e3a2b8ccd 100644 --- a/frappe/public/js/frappe/form/grid_row.js +++ b/frappe/public/js/frappe/form/grid_row.js @@ -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 = {}; @@ -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) :