diff options
Diffstat (limited to 'addons/web/static/src/js/chrome/abstract_web_client.js')
| -rw-r--r-- | addons/web/static/src/js/chrome/abstract_web_client.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/addons/web/static/src/js/chrome/abstract_web_client.js b/addons/web/static/src/js/chrome/abstract_web_client.js index 95d9868b89a..39da829f209 100644 --- a/addons/web/static/src/js/chrome/abstract_web_client.js +++ b/addons/web/static/src/js/chrome/abstract_web_client.js @@ -126,7 +126,10 @@ var AbstractWebClient = Widget.extend(KeyboardNavigationMixin, { if (!state.cids) { state.cids = utils.get_cookie('cids') !== null ? utils.get_cookie('cids') : String(current_company_id); } - var stateCompanyIDS = _.map(state.cids.split(','), function (cid) { return parseInt(cid) }); + // If a key appears several times in the hash, it is available in the + // bbq state as an array containing all occurrences of that key + const cids = Array.isArray(state.cids) ? state.cids[0] : state.cids; + let stateCompanyIDS = cids.split(',').map(cid => parseInt(cid, 10)); var userCompanyIDS = _.map(session.user_companies.allowed_companies, function(company) {return company[0]}); // Check that the user has access to all the companies if (!_.isEmpty(_.difference(stateCompanyIDS, userCompanyIDS))) { |
