The below code was written to enable archive button for a particular user group
odoo.define('hr_idc.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 = ['hr.employee'].includes(self.controllerParams.modelName) ? 'True' : 'False';
if (model) {
session.user_has_group(['hr_idc.group_hr_itadmin']).then(function(has_group) {
if (!has_group) {
self.controllerParams.archiveEnabled = 'False' in viewInfo.fields;
}
});
}
},
});
});
now, I want to enable it for another user group
I have tried this
session.user_has_group(['hr_idc.group_hr_itadmin', 'hr_idc.group_hr_hradmin']).then(function(has_group) {
it enables the archive button for 'hr_idc.group_hr_hradmin'. but whenever I go to that page the below error appears
File "C:\Users\hp\odoo15\server\odoo\addons\base\models\res_users.py", line 841, in has_group return self._has_group(group_ext_id) File "", line 2, in _has_group File "C:\Users\hp\odoo15\server\odoo\tools\cache.py", line 95, in lookup return self.method(*args, **kwargs) File "C:\Users\hp\odoo15\server\odoo\addons\base\models\res_users.py", line 854, in _has_group assert group_ext_id and '.' in group_ext_id, "External ID '%s' must be fully qualified" % group_ext_id Exception The above exception was the direct cause of the following exception: Traceback (most recent call last): File "C:\Users\hp\odoo15\server\odoo\http.py", line 654, in _handle_exception return super(JsonRequest, self)._handle_exception(exception) File "C:\Users\hp\odoo15\server\odoo\http.py", line 301, in _handle_exception raise exception.with_traceback(None) from new_cause AssertionError: External ID '['hr_idc.group_hr_itadmin', 'hr_idc.group_hr_hradmin']' must be fully qualified
how to do this for multiple group. or how can i avoid this error