Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
3 Antwoorden
6213 Weergaven


@api.v7

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?

Avatar
Annuleer
Beste antwoord

You may try like this - 

@api.multi
def moves_xml(self,context=None):
    context = context or {}   
    partial = self.env['website.seo.wizard'].create({})
   return {
           'name':"Message",
          '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': '[]',
       }


Avatar
Annuleer
Beste antwoord

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

@api.multi
def moves_xml(self):
view_id = self.env.ref('module_name.record_id_of_form').id
context = self._context.copy()
return {
'name':'form_name',
'view_type':'form',
'view_mode':'tree',
'views':[(view_id,'form')],
'res_model':'account.export',
'view_id':view_id,
'type':'ir.actions.act_window',
'res_id': account.id,
'target':'new',
}


Avatar
Annuleer
Auteur Beste antwoord

Thank you both!


@api.multi did the thing

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

Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
1
apr. 25
7231
1
dec. 22
3220
7
sep. 20
7300
3
nov. 23
32043
4
jul. 25
4795