diff options
| author | Géry Debongnie <ged@odoo.com> | 2017-04-22 20:56:27 +0200 |
|---|---|---|
| committer | Géry Debongnie <ged@odoo.com> | 2017-04-24 10:13:54 +0200 |
| commit | d8261d1162086e5c299e9ee364b7ac0476ea6fee (patch) | |
| tree | c323e164fff14afbaa6e59cbcc7ade723b6c25ee /addons/web/static/src/js/views/basic/basic_model.js | |
| parent | 1561165fe25c33ea773d76710b2c94e7d71968d4 (diff) | |
[FIX] web: fix issues when deleting records
This commit solves two issues with deletion:
- deleting the last record in a form view now triggers a history_back
action, which means that the view will be changed back to the main
view (a list view for example), instead of staying in form view
- deleting a record did reload the view twice in some cases.
Diffstat (limited to 'addons/web/static/src/js/views/basic/basic_model.js')
| -rw-r--r-- | addons/web/static/src/js/views/basic/basic_model.js | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/addons/web/static/src/js/views/basic/basic_model.js b/addons/web/static/src/js/views/basic/basic_model.js index 62898a338bd..e737df9cc9e 100644 --- a/addons/web/static/src/js/views/basic/basic_model.js +++ b/addons/web/static/src/js/views/basic/basic_model.js @@ -183,17 +183,14 @@ var BasicModel = AbstractModel.extend({ * parent. * * @todo we should remove the deleted records from the localData - * @todo is it really necessary to reload the data? it seems artificial, and - * the caller should be able to do that himself * @todo why can't we infer modelName? * * @param {string[]} recordIds list of local resources ids. They should all * be of type 'record', and of the same model * @param {string} modelName - * @param {string} parentID * @returns {Deferred} */ - deleteRecords: function (recordIds, modelName, parentID) { + deleteRecords: function (recordIds, modelName) { var self = this; var records = _.map(recordIds, function (id) { return self.localData[id]; }); return this._rpc({ @@ -208,9 +205,6 @@ var BasicModel = AbstractModel.extend({ record.res_id = record.res_ids[record.offset]; record.count--; }); - if (parentID) { - return self.reload(parentID); - } }); }, /** |
