I need to add a button in each row of a report. That i need to see some data while clicking on the button. The data will be change according to the value of the report line with some conditions.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
Hi,
You need to just add a button inside the report lines just like this.
<field name="report_line" nolabel="1">
<tree>
<button name="list_view" string="button" type="object"/>
</tree>
</field>
Then, we need to define a function inside the report_line model to get the view according to your needs.
def list_view(self):
view_tree = self.env.ref('module_name.view_id').id
return {
'type': 'ir.actions.act_window',
'name': 'Name',
'view_mode': 'tree',
'res_model': 'model for the view',
'view_id': view_tree,
'domain': [()],
'context': "{'create': False}"
}
So here you need to find the view id, that we need to show and also you can give any domain according to your needs
Regards
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
1
thg 7 24
|
1817 | ||
|
0
thg 9 24
|
1285 | ||
|
1
thg 5 24
|
2290 | ||
|
2
thg 6 23
|
2533 | ||
|
0
thg 1 20
|
160 |