Revert 3dec090 "[FIX] ir_values: fallback when no condition"

An ir.value without condition should not match when searching with a condition.
When a field with change_default on it is modified, the method get_defaults is called with the new value. This means that manually modifying a field with this trigger would put back the default value (opw 611193).
This commit is contained in:
Martin Trigaux 2014-07-28 14:35:44 +02:00
parent 3fe508f200
commit cd013aa09a
1 changed files with 2 additions and 2 deletions

View File

@ -310,10 +310,10 @@ class ir_values(osv.osv):
(SELECT company_id from res_users where id = %%s)
)
%s
ORDER BY v.user_id, u.company_id, v.key2"""
ORDER BY v.user_id, u.company_id"""
params = ('default', model, uid, uid)
if condition:
query %= 'AND (v.key2 = %s OR v.key2 IS NULL)'
query %= 'AND v.key2 = %s'
params += (condition[:200],)
else:
query %= 'AND v.key2 is NULL'