Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
4453 Vizualizări

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?

Imagine profil
Abandonează
Cel mai bun răspuns

See similar ask.

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
0
sept. 20
2837
0
apr. 16
3190
3
mar. 16
13971
1
mar. 15
12395
0
mar. 15
3219