Skip to content

Commit

Permalink
fix: update property if field exist
Browse files Browse the repository at this point in the history
(cherry picked from commit 66df0e9)
  • Loading branch information
shariquerik authored and mergify[bot] committed Apr 12, 2023
1 parent 3dc215d commit 3f10e63
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion frappe/public/js/frappe/form/grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -1189,7 +1189,10 @@ export default class Grid {
this.docfields.find((d) => d.fieldname === fieldname)[property] = value;

if (this.user_defined_columns && this.user_defined_columns.length > 0) {
this.user_defined_columns.find((d) => d.fieldname === fieldname)[property] = value;
let field = this.user_defined_columns.find((d) => d.fieldname === fieldname);
if (field && Object.keys(field).includes(property)) {
field[property] = value;
}
}

this.debounced_refresh();
Expand Down

0 comments on commit 3f10e63

Please sign in to comment.