Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

odoo9 view problem

By
wizardz
on 8/10/16, 3:13 AM 193 views

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?

1

Pawan

--Pawan--
1267
| 4 3 5
Hyderabad, India
--Pawan--


Pawan
On 8/10/16, 8:34 AM

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!!

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

wizardz
on 8/10/16, 8:58 AM

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

thank you

wizardz
on 8/10/16, 9:09 AM
0
Irfankhan Juneja
On 8/10/16, 8:39 AM

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',

}

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 8/10/16, 3:13 AM
Seen: 193 times
Last updated: 8/10/16, 9:08 AM