hello guys, i have a problem hiding action archive/unarchive on specific models. i have tried to make a condition to check for few models.. the code is working but on all of the models
im using odoo 11
here are my JS:
odoo.define("wpd_inventory.BasicView", function(require) {
"use strict";
var session = require('web.session');
var BasicView = require('web.BasicView');
BasicView.include({
init: function(viewInfo, params) {
var self = this;
this._super.apply(this, arguments);
var model = self.controllerParams.modelName in ['product.product','product.template'] ? 'True' : 'False';
if(!model) {
self.controllerParams.archiveEnabled = 'active' in viewInfo.fields;
} else {
session.user_has_group('wpd_inventory.group_archive_data').then(function(has_group) {
if(!has_group) {
self.controllerParams.archiveEnabled = 'False' in viewInfo.fields;
}
})
}
},
});
return BasicView;
});
thank you for your help
thank you for your help