Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

on_change inside linked one2many class

By
Shaumyadeep Chaudhuri
on 7/30/13, 11:38 AM 1,406 views

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?

1

Vasiliy Birukov

--Vasiliy Birukov--
3446
| 6 6 8
Russian Federation
--Vasiliy Birukov--

Help develop and implement any project on base Odoo.

Vasiliy Birukov
On 7/31/13, 9:48 AM

See similar ask.

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 7/30/13, 11:38 AM
Seen: 1406 times
Last updated: 3/16/15, 8:10 AM