[FIX] expression: allow exclusion of records with translated fields
[odoo/odoo.git] / bin / addons / base / test / test_osv_expression.yml
index 4916fe0..e8b199f 100644 (file)
         res_ids = self.search(cr, uid, [('company_id.partner_id', 'not in', [])])
         res_ids.sort()
         assert res_ids == all_ids, "Searching against empty set failed, returns %r" % res_ids
+-
+    Check that we can exclude translated fields (bug lp:1071710)
+-
+    !python {model: res.country}: |
+        # first install french language
+        BLI = self.pool.get('base.language.install')
+        BLI.lang_install(cr, uid, [BLI.create(cr, uid, {'lang': 'fr_FR'})])
+
+        be_id = self.search(cr, uid, [('name', '=', 'Belgium')])[0]
+
+        ctx = {'lang': 'fr_FR'}
+        not_be = self.search(cr, uid, [('name', '!=', 'Belgique')], context=ctx)
 
+        assert be_id not in not_be, "Search match failed"