Code review comment for lp:~akretion-team/banking-addons/bank-statement-reconcile-70-api-improvement

Revision history for this message
Sébastien BEAU - http://www.akretion.com (sebastien.beau) wrote :

Hi Stéphane, I agree it will be great to always use this everywhere in banking addons and better in all OCA module! we can update the MP in this direction.

After thinking twice, and before we change it everywhere. I am not sure that using get_... and _get... is a good idea because the "get_..." method didn't have as signature the "cr, uid, ids...."

Maybe it will be better to use _get and __get ?

def _get_functions(self, cr, uid, context=None):
    """
    List of available methods for rules. Override this to add you own.
    """
    #Add you code here ....

def __get_functions(self, cr, uid, context=None):
        """
        This method can not be inherited call get_functions instead
        """
        return self._get_functions(cr, uid, context=context)

We can use this convention everywhere in OCA double underscore : "__" mean that you can not inherit the method because OpenERP call it directly.

What you you think?

« Back to merge proposal