Odoo Help


How do I return an act-window in v8?

Anders Wallenquist
on 9/4/15, 6:18 AM 1,703 views


def moves_xml(self,cr,uid,ids,context=None):

do some stuff with v7-syntax/api....

return {

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

'res_model': 'account.export',

'view_mode': 'form',

'view_type': 'form',

'res_id': account.id,

'views': [(False, 'form')],

'target': 'new',


How do I open the same window with the v8 api?

On 9/4/15, 7:19 AM

You may try like this - 

def moves_xml(self,context=None):
    context = context or {}   
    partial = self.env['website.seo.wizard'].create({})
   return {
          'view_mode': 'form',
          'view_id': False,
          'view_type': 'form',
          'res_model': 'website.seo.wizard',
          'res_id': partial.id,
          'type': 'ir.actions.act_window',
          'nodestroy': True,
          'target': 'new',
          'domain': '[]',

Indrabhan Bhamare
On 9/4/15, 7:35 AM

hello Anders

I have made some changes in your piece of code.Try to understand the hint/change.

hope this hint/change may help you or may solve your problem

def moves_xml(self):
view_id = self.env.ref('module_name.record_id_of_form').id
context = self._context.copy()
return {
'res_id': account.id,

Anders Wallenquist
On 9/4/15, 9:47 AM

Thank you both!

@api.multi did the thing

I tried @api.one and others with no luck before i got back to v7-syntax.

About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 9/4/15, 6:18 AM
Seen: 1703 times
Last updated: 9/4/15, 9:47 AM