I want to override a function called 'user_has_groups' in the class from the file openerp/models.py (line no 1365)
I tried the code from this post and this question
from openerp.models import BaseModel
def my_user_has_groups(self, cr, uid, groups, context=None):
#my code
BaseModel.user_has_groups = my_user_has_groups
But it results the following error.
TypeError: my_user_has_groups() takes at least 4 arguments (2 given)
and also i tried this line
BaseModel.user_has_groups = lambda cr, uid, groups, context: my_user_has_groups(cr, uid, groups, context)
It results the following error
QWebException: <lambda>() got multiple values for keyword argument 'groups'
I also tried the code from this post. But it doesn't work.
How I can achieve this? Please enlighten me.