openerp-community team mailing list archive
-
openerp-community team
-
Mailing list archive
-
Message #05362
Re: Reason to deprecate check_recursion() ?
Le 31/03/2014 14:57, Lionel Sausin a écrit :
Dear Olivier,
In v7 I just noticed that check_recursion() is deprecated in favor of
_check_recursion().
That makes it a protected method, so by convention it should only be
used inside osv.orm shouldn't it?
Would you please be kind enough to explain the reason for this and if
it's OK to call _check_recursion() in our own "Model"s?
I'm asking because now pylint is looking down on me for using a
protected method - I just want to make I'm doing it right.
Lionel.
Uh ok, I figured out I need to override _check_recursion in my own Model
anyway...
Sorry for the noise.
def _check_recursion(self, cr, uid, ids, context=None, parent=None):
return super(MyOwnModel, self)._check_recursion(
cr, uid, ids, context=context, parent=parent)
Follow ups
References