diff --git a/frappe/public/js/frappe/form/grid.js b/frappe/public/js/frappe/form/grid.js index eacefe8d26..36025fec85 100644 --- a/frappe/public/js/frappe/form/grid.js +++ b/frappe/public/js/frappe/form/grid.js @@ -834,7 +834,11 @@ export default class Grid { if (!this.df.data) { this.df.data = this.get_data() || []; } - this.df.data.push({ idx: this.df.data.length + 1, __islocal: true }); + const defaults = this.docfields.reduce((acc, d) => { + acc[d.fieldname] = d.default; + return acc; + }, {}); + this.df.data.push({ idx: this.df.data.length + 1, __islocal: true, ...defaults }); this.refresh(); }