[FIX] ir_values: missing trimming of the condition (as done elsewhere).
authorVo Minh Thu <vmt@openerp.com>
Mon, 3 Oct 2011 15:40:08 +0000 (17:40 +0200)
committerVo Minh Thu <vmt@openerp.com>
Mon, 3 Oct 2011 15:40:08 +0000 (17:40 +0200)
bzr revid: vmt@openerp.com-20111003154008-k8dm2r3yhintm0ql

openerp/addons/base/ir/ir_values.py

index d908c20..15e8f3b 100644 (file)
@@ -233,7 +233,7 @@ class ir_values(osv.osv):
         # remove existing defaults for the same scope
         search_criteria = [
             ('key', '=', 'default'),
-            ('key2', '=', condition),
+            ('key2', '=', condition and condition[:200]),
             ('model', '=', model),
             ('name', '=', field_name),
             ('user_id', '=', False if for_all_users else uid),