Error Occured While Overriding The Search Function Of A Class In Openerp
I tried to override search function of class 'project' to filter the projects.But its not give a list, which i need. It just load all value from the model . From where I need to pa
Solution 1:
You need to pass it from xml code. It should be many2one with project.project and add the context like context="{'test': 'yes'}" in xml file where you define this field like this:
<fieldname="project_id"context="{'test': 'test'}"/>
By overriding search method of project.project, check this context. Now you should get this context in search method.
If you get this context, fire your query, get the result accordingly it and return it as list of ids. If you don't get, return super method of project.project as specified in the code. Also, remove the condition of if user==1 as per your need, you do not require it otherwise it will come up with all list of projects.
Post a Comment for "Error Occured While Overriding The Search Function Of A Class In Openerp"