Code 1:
var my_var = false;
var Users = new openerp.web.Model('res.users');
Users.call('has_group', ['account.group_account_manager']).then(function(result) {my_var = result;});
if (my_var == false){..)
Code 2:
if (Users.call('has_groups', ['group_account_manager']).done(function(belongs_to_all_groups) {
if(belongs_to_all_groups){
Code 3:
var user = require('res.users');
if (user.call('has_groups', ['group_account_manager']).done(function(belongs_to_all_groups) {
if(belongs_to_all_groups){..}
Attempts that didn't work in v12