跳至内容
菜单
此问题已终结
1 回复
4462 查看

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?

形象
丢弃
最佳答案

See similar ask.

形象
丢弃
相关帖文 回复 查看 活动
0
9月 20
2838
0
4月 16
3193
3
3月 16
13972
1
3月 15
12397
0
3月 15
3219