Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
4472 Tampilan

Hi, Is it possible to put a on_change inside the py file? I have a one2many field

'target_trainees' : fields.one2many('training.registeration','target_employee_id','Target Trainees'),

and the related class is

class training_registration(osv.osv): _name = 'training.registeration'

def onchange_target_employee(self,cr,uid,ids,target_employee_id,context=None):
   pass

_columns = {
            'target_employee_id' : fields.many2one('hr.employee','Employee'),
            'email': fields.char('Email', size=64,readonly=True),
            'phone': fields.char('Phone', size=64,readonly=True),
            'state': fields.selection([('draft', 'Unconfirmed'),
                                ('cancel', 'Cancelled'),
                                ('open', 'Confirmed'),
                                ('done', 'Attended')], 'Status',
                                track_visibility='onchange',
                                size=16, readonly=True),
            }

I do not include the training_registration class columns directly in my xml view. When i add records to the one2many fields I get a popup to fill in the fields of the training_registration class. What i want is to call an on_change event when i select the employee and put in his email and mail accordingly though the on_change method.

How can i do that?

Avatar
Buang
Jawaban Terbai

See similar ask.

Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
0
Sep 20
2842
0
Apr 16
3198
3
Mar 16
13982
1
Mar 15
12400
0
Mar 15
3220