From 4b88138b59a59021f75ab147cf2ac884f76810ea Mon Sep 17 00:00:00 2001 From: Vo Minh Thu Date: Mon, 6 Jun 2011 12:58:26 +0200 Subject: [PATCH] [IMP] make sure all _constraints methods can receive a context arg. bzr revid: vmt@openerp.com-20110606105826-cq1epnpfnzm3yofa --- addons/analytic/analytic.py | 4 ++-- addons/l10n_ch/invoice.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/analytic/analytic.py b/addons/analytic/analytic.py index 6dfaac21e70..d822c382c91 100644 --- a/addons/analytic/analytic.py +++ b/addons/analytic/analytic.py @@ -202,8 +202,8 @@ class account_analytic_account(osv.osv): 'currency_id': _get_default_currency, } - def check_recursion(self, cr, uid, ids, parent=None): - return super(account_analytic_account, self)._check_recursion(cr, uid, ids, parent=parent) + def check_recursion(self, cr, uid, ids, context=None, parent=None): + return super(account_analytic_account, self)._check_recursion(cr, uid, ids, context=context, parent=parent) _order = 'name asc' _constraints = [ diff --git a/addons/l10n_ch/invoice.py b/addons/l10n_ch/invoice.py index 07c62d43d51..af9beac55e0 100644 --- a/addons/l10n_ch/invoice.py +++ b/addons/l10n_ch/invoice.py @@ -84,7 +84,7 @@ class account_invoice(osv.osv): ## @param user res.user.id that is currently loged ## @parma ids invoices id ## @return a boolean True if valid False if invalid - def _check_bvr(self, cr, uid, ids): + def _check_bvr(self, cr, uid, ids, context=None): """ Function to validate a bvr reference like : 0100054150009>132000000000000000000000014+ 1300132412> @@ -111,7 +111,7 @@ class account_invoice(osv.osv): ## @param user res.user.id that is currently loged ## @parma ids invoices id ## @return a boolean True if valid False if invalid - def _check_reference_type(self, cursor, user, ids): + def _check_reference_type(self, cursor, user, ids, context=None): """Check the customer invoice reference type depending on the BVR reference type and the invoice partner bank type""" for invoice in self.browse(cursor, user, ids): @@ -196,4 +196,4 @@ class account_tax_code(osv.osv): account_tax_code() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: