We are actually in the process to decide the behavior of search on O2M and M2M for blank ids.
Search of blank ids on O2M and M2M might be treated by one of the ways as said below OR a CONCRETE way which can ensure a perfect result.
AIM 1 : Get all partners with no address self.pool.get('res.partner').search(cr, uid, [('address','in',[])])
Result : I get partners whose address is null. Conclusion : Result is RIGHT.
AIM 2 : Get all partners with city='mycity' (search on related)
First domain goes as [('city','ilike','mycity')]
It is converted to a DB compatible query domain as city is a field of address.
there are no addresses which match 'mycity' anyhow. self.pool.get('res.partner').search(cr, uid, [('address','in',[])])
Result : I get partners whose address is null.
Conclusion : Result is WRONG.
Expected result : no partners.( Logically I searched as partners with city 'mycity')
We would like to have views from you where we can end up best solutions for the 2 cases mentioned above.
Hi Experts,
We are actually in the process to decide the behavior of search on O2M and M2M for blank ids.
Search of blank ids on O2M and M2M might be treated by one of the ways as said below OR a CONCRETE way which can ensure a perfect result.
AIM 1 : Get all partners with no address
self. pool.get( 'res.partner' ).search( cr, uid, [('address' ,'in',[ ])])
Conclusion : Result is RIGHT.
Result : I get partners whose address is null.
AIM 2 : Get all partners with city='mycity' (search on related) ,'ilike' ,'mycity' )]
self. pool.get( 'res.partner' ).search( cr, uid, [('address' ,'in',[ ])])
First domain goes as [('city'
It is converted to a DB compatible query domain as city is a field of address.
there are no addresses which match 'mycity' anyhow.
Result : I get partners whose address is null.
Conclusion : Result is WRONG.
Expected result : no partners.( Logically I searched as partners with city 'mycity')
We would like to have views from you where we can end up best solutions for the 2 cases mentioned above.
Thanks.