Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
3750 Переглядів

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

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
1
лип. 24
1635
0
вер. 24
1041
1
трав. 24
2155
2
черв. 23
2372
0
січ. 20
160