تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
7108 أدوات العرض

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, }

الصورة الرمزية
إهمال
أفضل إجابة

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

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
2
ديسمبر 23
13333
3
يوليو 22
23782
2
يونيو 21
18996
0
سبتمبر 20
4018
0
مايو 16
4475