Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

How to call Filtered tree view through button?

By
arsalan
on 8/8/14, 8:44 AM 1,253 views

I wanted to know that how may I call the tree view(of different records) through a button . Because returning form view is easy but when I tried to do exact thing for tree view it shows a list only.

The scenario is that I have a search product form. Now when the search is generated,a domain of records is filled in the field.

I want to add a button to call the tree view showing me the records present in that domain. I added a function to button but it showed me all the record in a list , didnot even show only the records in the domain.

I have tried to call the following function through a button-click but it did not meet my needs:

 

def views(self,cr,uid,ids,context=None):

       for id in ids:

             deg_obj=self.pool.get('deg.form').browse(cr,uid,id)    

             my_id=int(deg_obj.my_products)

       return{ 'view_type': 'tree',

                    'view_mode': 'tree',

                    'res_model': 'product.product',

                    'res_id':my_id,

                    'context': context,

                    'type': 'ir.actions.act_window',

                    'readonly':True, }

0

IBS

--IBS--
1302
| 4 5 8
Tétouan, Morocco
--IBS--

For more informations about IBS, please visit our website at www.ibs-na.com.

For a specific questions, collaboration or help, please send us an email to support@ibs-na.com

IBS
On 8/10/14, 1:36 PM

You have to return a domain in your object, either that or a search_default_FIELDNAME in the context.

Your Answer

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

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 8/8/14, 8:44 AM
Seen: 1253 times
Last updated: 3/16/15, 8:10 AM