Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
3 Vastaukset
10229 Näkymät

Hi there
I have module with many standards 1, 2 and 3  every standard have some students and i want to create attendance sheets for every standard
i want that when i choose standard 1 ,2 or 3  in form view the students in this standard loaded automatically n the form.
Can odoo do that or i should add students to the form view every time ?

 

Avatar
Hylkää
Paras vastaus

If it is possible you use onchange and RedirectWarning

UPDATE:

     @api.onchange('my_field')
     def do_my_field(self):
            if self.my_field == "FOO":
               model, action_id = self.pool['ir.model.data'].get_object_reference(cr, uid, 'my_module', 'my_action')
               msg = _("FOO FOO FOO.")
               raise openerp.exceptions.RedirectWarning(msg, action_id, _('Go to MY ACTION'))

 

Avatar
Hylkää

If you want to send to a specific record id, how do you do ?

Tekijä Paras vastaus

can i have Example ? @zbik ?

Avatar
Hylkää

answer updated

Paras vastaus

You need onchange method for your form fileds.

For examples just search odoo sourcecode with "onchange" keyword. 

Avatar
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
8
syysk. 21
18681
2
syysk. 16
6677
0
maalisk. 15
4006
1
maalisk. 15
4361
0
jouluk. 18
5349