diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py
index 3afb95ec54faab72debad29acb5b273084931174..48f227639861e801d9d2eabfb9fba7276525011a 100644
--- a/addons/account/account_invoice.py
+++ b/addons/account/account_invoice.py
@@ -815,7 +815,7 @@ class account_invoice(models.Model):
             inv.check_tax_lines(compute_taxes)
 
             # I disabled the check_total feature
-            if self.env['res.users'].has_group('account.group_supplier_inv_check_total'):
+            if self.env.user.has_group('account.group_supplier_inv_check_total'):
                 if inv.type in ('in_invoice', 'in_refund') and abs(inv.check_total - inv.amount_total) >= (inv.currency_id.rounding / 2.0):
                     raise except_orm(_('Bad Total!'), _('Please verify the price of the invoice!\nThe encoded total does not match the computed total.'))
 
diff --git a/openerp/addons/base/res/res_users.py b/openerp/addons/base/res/res_users.py
index 0a2d8339ac5040f60a5373909ab8dc0dcc774b8f..c0a6d484f1b4c03ea06e80659c83d497a757c717 100644
--- a/openerp/addons/base/res/res_users.py
+++ b/openerp/addons/base/res/res_users.py
@@ -556,7 +556,7 @@ class res_users(osv.osv):
     def has_group(self, group_ext_id):
         # use singleton's id if called on a non-empty recordset, otherwise
         # context uid
-        uid = self.id if self else self.env.uid
+        uid = self.id or self.env.uid
         return self._has_group(self.env.cr, uid, group_ext_id)
 
     @api.noguess