diff options
| author | Sébastien Theys <seb@odoo.com> | 2020-07-31 13:48:31 +0000 |
|---|---|---|
| committer | Sébastien Theys <seb@odoo.com> | 2020-07-31 14:43:15 +0000 |
| commit | 0d4cb52b9dcd56cb463f2168eaea7a0e8fc2d9a8 (patch) | |
| tree | 109758dce03461b2cc8e0327ab833f0dc19790cf /addons/mail/static/src/models/model/model.js | |
| parent | 7a1bfa793a6e0d47b1574cd9cc44f6dd00d910f2 (diff) | |
[FIX] mail: batch create/insert of JS model for performance
PR: #55261
Part of task-2308312
closes odoo/odoo#55266
X-original-commit: eded5f6372d4f1cffd1a361bd8fa7fd8f1f8ae9e
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Diffstat (limited to 'addons/mail/static/src/models/model/model.js')
| -rw-r--r-- | addons/mail/static/src/models/model/model.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/addons/mail/static/src/models/model/model.js b/addons/mail/static/src/models/model/model.js index 15647acaf49..6ee5125426d 100644 --- a/addons/mail/static/src/models/model/model.js +++ b/addons/mail/static/src/models/model/model.js @@ -61,8 +61,9 @@ function factory() { * function, otherwise the record will not be registered. * * @static - * @param {Object} [data] data object with initial data, including relations. - * @returns {mail.model} newly created record + * @param {Object|Object[]} [data] data object with initial data, including relations. + * If data is an iterable, multiple records will be created. + * @returns {mail.model|mail.model[]} newly created record(s) */ static create(data) { return this.env.modelManager.create(this, data); @@ -99,8 +100,9 @@ function factory() { * on provided data. * * @static - * @param {Object} data - * @returns {mail.model} created or updated record. + * @param {Object|Object[]} data + * If data is an iterable, multiple records will be created/updated. + * @returns {mail.model|mail.model[]} created or updated record(s). */ static insert(data) { return this.env.modelManager.insert(this, data); |
