Hi,
I have a many2many field "tag_ids" both in models "news.ads" and "blog.post".
I want to get all the records from "blog.post" whose "tag_ids" exactly matches the "tag_ids" in "news.ads".
I tried the following in my controller but it doesn't worked,
blog_obj = request.registry['blog.post']
p_id = blog_obj.search(cr, uid, ['&', ['id','=',post_id], ['website_published', '=', True]], context=context)
post = blog_obj.browse(cr, uid, p_id, context=context)
ad_obj = request.registry['news.ads']
banner_ads = ad_obj.search(cr, uid, [('state', '=', 'publish'), ('tag_ids', 'in', [post.tag_ids])], context=context)
How do I search such records in odoo9? Any workaround..!!