Skip to content

Commit

Permalink
[IMP] add web client custom module archive
Browse files Browse the repository at this point in the history
  • Loading branch information
David Arnold committed Aug 3, 2018
1 parent 5b21701 commit 47b2c04
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion addons/web/static/src/js/views/basic/basic_model.js
Expand Up @@ -1231,10 +1231,17 @@ var BasicModel = AbstractModel.extend({
var resIDs = _.map(recordIDs, function (recordID) {
return self.localData[recordID].res_id;
});
var write_dict;
if (parent.fields.x_active) {
write_dict = { x_active: value };
} else {
write_dict = { active: value };
}

return this._rpc({
model: parent.model,
method: 'write',
args: [resIDs, { active: value }],
args: [resIDs, write_dict],
})
.then(function () {
// optionally clear the DataManager's cache
Expand Down
2 changes: 1 addition & 1 deletion addons/web/static/src/js/views/basic/basic_view.js
Expand Up @@ -45,7 +45,7 @@ var BasicView = AbstractView.extend({
this.rendererParams.viewType = this.viewType;

this.controllerParams.confirmOnDelete = true;
this.controllerParams.archiveEnabled = 'active' in this.fields;
this.controllerParams.archiveEnabled = 'active' in this.fields || 'x_active' in this.fields;
this.controllerParams.hasButtons =
'action_buttons' in params ? params.action_buttons : true;

Expand Down

0 comments on commit 47b2c04

Please sign in to comment.