I have created Automated Action on invoice object.
On Creation & Update |
Server Action :
sale_order = env['sale.order'].search([('invoice_ids', '=', object.id)])
object.write({'comment': sale_order})
sale_order is display All sale order.
Any one can help to search on many2many field.