From 8848af76f0020c82a7543848c5783e6b0e3f73d9 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Tue, 12 Jan 2016 15:13:17 +0100 Subject: [PATCH] [IMP] account: recordset calling conventions for fixed has_group --- addons/account/account_invoice.py | 2 +- openerp/addons/base/res/res_users.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index 3afb95ec54f..48f22763986 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 0a2d8339ac5..c0a6d484f1b 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