[IMP] web: combine user context with record context on 'deleteRecords'

This commit is contained in:
Kinjal Mehta
2018-02-06 08:56:54 +01:00
committed by Yannick Tivisse
parent 89c07862d5
commit 05fc6f52d0
@@ -228,11 +228,12 @@ var BasicModel = AbstractModel.extend({
deleteRecords: function (recordIds, modelName) {
var self = this;
var records = _.map(recordIds, function (id) { return self.localData[id]; });
var context = _.extend(records[0].getContext(), session.user_context);
return this._rpc({
model: modelName,
method: 'unlink',
args: [_.pluck(records, 'res_id')],
context: session.user_context, // todo: combine with view context
context: context,
})
.then(function () {
_.each(records, function (record) {