İçereği Atla
Menü
Bu soru işaretlendi
1 Cevapla
3386 Görünümler
class clstest(models.Model):
_name = "cla"
    #This is main form
rps = fields.Many2many('clb', 'rp_rel', 'cla_id', 'clb_id', u'List')

@api.multi
def btn1(self):
return {
'type': 'ir.actions.act_window',
'res_model': 'clb',
'view_type': 'form',
'view_mode': 'form',
'context': self.env.context,
'target': 'new',
}
class classt1(models.Model):
_name = "clb"
    #This is Wizard Form   
name = fields.Char(string=u"Code")

@api.model
def create(self, vals):

res = super(classt1, self).create(vals)
rid = [res.id]#send rid to rps
return res
<header>
<button name="btn1" string="BTN Test" type="object" class="oe_highlight"/>

</header>

How to send "id created" wizard to "rps" main form?

Thanks.









Avatar
Vazgeç
En İyi Yanıt

Hi,

Usually you add buttons to your wizards, as dismiss or cancel and apply or confirm,...

On one of these buttons you call a method. In this method you set the rps field to the id of the wizard. So your create method is not needed, but a method called action_apply for example. This action is called on the button click of the wizard. You need to implement this action.

Avatar
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
0
Oca 16
3428
1
Haz 15
13569
1
Mar 15
4650
0
Mar 15
7262
0
Tem 22
2274