In Openerp 7 User login list view display record always with domain conditions. But while searching the record remove the domain condition temporarily and return the output based on user input. Based on search method overridden and below code used.
<record id="action_custommodel_view" model="ir.actions.act_window">
<field name="view_id" ref="view_samplemodule_tree"/>
def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None,count=False, extra=None):
if uid == 1:
if len(args) == 1:
user_domain = args
if uid !=1 and len(args)>1:
if uid !=1 and not args:
return super(sample_one, self).search(cr, uid, args, offset, limit, order, context, count)
Let me know wheter about code is right or not?..
Please correct me if i am going wrong...
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
About This Community
|Asked: 7/15/14, 9:17 AM|
|Seen: 2825 times|
|Last updated: 6/7/15, 6:44 AM|