[IMP] account: recordset calling conventions for fixed has_group
This commit is contained in:
parent
ccb0f6db61
commit
8848af76f0
|
@ -815,7 +815,7 @@ class account_invoice(models.Model):
|
||||||
inv.check_tax_lines(compute_taxes)
|
inv.check_tax_lines(compute_taxes)
|
||||||
|
|
||||||
# I disabled the check_total feature
|
# 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):
|
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.'))
|
raise except_orm(_('Bad Total!'), _('Please verify the price of the invoice!\nThe encoded total does not match the computed total.'))
|
||||||
|
|
||||||
|
|
|
@ -556,7 +556,7 @@ class res_users(osv.osv):
|
||||||
def has_group(self, group_ext_id):
|
def has_group(self, group_ext_id):
|
||||||
# use singleton's id if called on a non-empty recordset, otherwise
|
# use singleton's id if called on a non-empty recordset, otherwise
|
||||||
# context uid
|
# 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)
|
return self._has_group(self.env.cr, uid, group_ext_id)
|
||||||
|
|
||||||
@api.noguess
|
@api.noguess
|
||||||
|
|
Loading…
Reference in New Issue