Merge pull request #23701 from pps190/fix-grid-defaults
This commit is contained in:
commit
f9b5d60ec9
1 changed files with 5 additions and 1 deletions
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue