fix: grid row default values with not using model
This commit is contained in:
parent
91dce0b007
commit
bb73d77cec
1 changed files with 7 additions and 1 deletions
|
|
@ -834,7 +834,13 @@ 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(
|
||||
$.extend({ idx: this.df.data.length + 1, __islocal: true }, defaults)
|
||||
);
|
||||
this.refresh();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue