跳至內容
選單
此問題已被標幟
1 回覆
3978 瀏覽次數

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.

頭像
捨棄
最佳答案

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

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
7月 24
1737
0
9月 24
1227
1
5月 24
2231
2
6月 23
2479
0
1月 20
160