Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
3 Trả lời
10201 Lượt xem

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 ?

 

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

 

Ảnh đại diện
Huỷ bỏ

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

Tác giả Câu trả lời hay nhất

can i have Example ? @zbik ?

Ảnh đại diện
Huỷ bỏ

answer updated

Câu trả lời hay nhất

You need onchange method for your form fileds.

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

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
8
thg 9 21
18665
2
thg 9 16
6661
0
thg 3 15
3997
1
thg 3 15
4348
0
thg 12 18
5340