Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
3 ตอบกลับ
6241 มุมมอง


@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?

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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': '[]',
       }


อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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


อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

Thank you both!


@api.multi did the thing

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

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
เม.ย. 25
7244
1
ธ.ค. 22
3258
7
ก.ย. 20
7322
What is wizard ? แก้ไขแล้ว
3
พ.ย. 23
32112
4
ก.ค. 25
4831