i have tried below code for onchange function but return some unreadable code
class sales_targets(models.Model):
_name = 'sale.target'
category = fields.Selection([
('normal', 'Product'), ('cloud', 'Cloud EYE'), ('tech', 'Technical Support Group'), ('db', 'Database'),
('odoo', 'Odoo'), ('can', 'CAN'), ('tod', 'TOD'), ('rental', 'Rental'), ('tec', 'TEC'), ('top', 'TOP'),
('tor', 'TOR'), ('tos', 'TOS'),
('aws', 'AWS')], 'Category', default='normal',
help="A category of the view type is a virtual category that can be used as the parent of another category to create a hierarchical structure.")
team_ids=fields.Many2many('crm.team','team_target_rel','target_ids','team_id','Sales Team')
from_date=fields.Date('Budget From Date')
to_date = fields.Date('Budget To Date')
no_call=fields.Float('No of Calls')
target_line=fields.One2many('target.line','target_id','Target Line', copy=True)
@api.multi
@api.onchange('team_ids')
def _onchange_tem_salesperson(self):
print ".....",self.id,self._origin
above code onchange function result is
...... <odoo.models.NewId object at 0x7f72aff2b290> sale.target()