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

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 ?

 

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

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'))

 

อวตาร
ละทิ้ง

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

ผู้เขียน คำตอบที่ดีที่สุด

can i have Example ? @zbik ?

อวตาร
ละทิ้ง

answer updated

คำตอบที่ดีที่สุด

You need onchange method for your form fileds.

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

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
8
ก.ย. 21
18667
2
ก.ย. 16
6664
0
มี.ค. 15
3998
Military states module -- help :D แก้ไขแล้ว
1
มี.ค. 15
4348
0
ธ.ค. 18
5340