Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
4 ตอบกลับ
6442 มุมมอง

Hi Mates,

I have a custom function and I need to display the return values on list view. anyone have any idea or example how to archive this?

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

As per your above explanation, you can create a view using SQL query as per the below link:

1). Create a custom model,

2). Create a Tree View,

3). Create a menu entry.

https://supportuae.wordpress.com/2017/09/10/creating-tree-view-report-using-sql-query/

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi, 

Suppose if this is the case,  like you need to list display the selected records in a tree view, you can pass those id's inside the domain, so that those records will only be shown. See this example,

action = {
'name': 'Translate',
'res_model': 'ir.translation',
'type': 'ir.actions.act_window',
'view_mode': 'tree',
'view_id': self.env.ref('base.view_translation_dialog_tree').id,
'target': 'current',
'flags': {'search_view': True, 'action_buttons': True},
'domain': [('id', 'in', list_of_ids)],
}
return action

Thanks

อวตาร
ละทิ้ง
ผู้เขียน

No. I need to pass new record set to the new tree view. simply I have a function which query my database and return the data set. I just call that function clicking the button and I just need to display all return values on the list view.

Related Posts ตอบกลับ มุมมอง กิจกรรม
Create new custom field type Odoo แก้ไขแล้ว
2
ก.พ. 19
10901
0
ต.ค. 18
4008
0
มี.ค. 15
4809
1
มี.ค. 15
4722
1
ม.ค. 23
10776