Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
2 Răspunsuri
2888 Vizualizări

In odoo9 I have these 2 views.

16 account.analytic.line.tree Tree account.analytic.line analytic.view_account_analytic_line_tree

16 account.analytic.line.tree Tree account.analytic.line hr_timesheet.hr_timesheet_line_tree


now when I make a function with a return, and I say them this:

 return {

'type': 'ir.actions.act_window',

'res_model': 'account.analytic.line',

'view_type': 'form',

'view_mode': 'tree',

}


I get every time on the analytic.view_account_analytic_line_tree view. But I wan't to go to the other view.

How can I fix this?

Imagine profil
Abandonează
Cel mai bun răspuns

wizards,

you can pass you new tree view id to show that view

view_id = record_id = self.env.ref('module_name.xml_id_of_record').id

 return {

'type': 'ir.actions.act_window',

'res_model': 'account.analytic.line',

'view_type': 'form',

'view_mode': 'tree',

'view_id': view_id

}


Hope it helps!!

Imagine profil
Abandonează
Autor

if I add this : view_id = self.env.ref('account.analytic.line.hr_timesheet.hr_timesheet_line_tree').id

#return sequence geändert zu 15..... not working

return {

'type': 'ir.actions.act_window',

'res_model': 'account.analytic.line',

'view_type': 'form',

'view_mode': 'tree',

'view_id': view_id, #1065

#'view_id': 'hr_timesheet.hr_timesheet_line_tree',

}

I get this error:

ValueError: External ID not found in the system: account.analytic.line.hr_timesheet_line_tree

Autor

I have fixed it, I need to take the right module : hr_timesheet.

thank you

Cel mai bun răspuns

return {

'name': 'any Name',

'view_type': 'form',

"view_mode": 'tree',

'res_model': 'account.analytic.line',

'type': 'ir.actions.act_window',

'res_id': id, # e.g. self.id

'target': 'current',

}

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
0
iul. 18
2521
2
oct. 16
5194
3
oct. 15
4594
1
feb. 25
12507
1
sept. 17
3596