This is my code:
class tickets(osv.Model): _name = 'tickets' _rec_name = 'code' _columns = {
'code': fields.char(string='Reference'),
'title': fields.char(string='Title', required=True),
'description': fields.text(string='Description', required=True),
'status': fields.selection(
[('draft', 'New'),
('open', 'In Progress'),
('pending', 'Pending'),
('validate', 'To Validate'),
('done', 'Closed'),
('cancel', 'Cancelled')], string='Status', required=True),
'related_ticket_ids': fields.many2many('tickets', 'related_tickets_rel', 'ticket_id1', 'ticket_id2', string='Related tickets'),
}
Imagine that we have 3 tickets created: ticket1, ticket2 and ticket3.
What I want is when I add in ticket1 (in the 'related_ticket_ids' field) the ticket2, in the ticket2's 'related_ticket_ids' field appears ticket1.