[FIX] OPW 577292: orm: fix _store_get_values() when requested for empty fields (unlin...
authorXavier ALT <xal@openerp.com>
Fri, 24 Aug 2012 14:03:36 +0000 (16:03 +0200)
committerXavier ALT <xal@openerp.com>
Fri, 24 Aug 2012 14:03:36 +0000 (16:03 +0200)
bzr revid: xal@openerp.com-20120824140336-1kfwa517y8m1qmh8

openerp/osv/orm.py

index 4a7fcbc..147ed8e 100644 (file)
@@ -4285,9 +4285,9 @@ class BaseModel(object):
         model_name_, func_field_to_compute_, id_mapping_fnct_, trigger_fields_, priority_ = range(5)
 
         # only keep functions that should be triggered for the ``fields``
-        # being written to.
+        # being written to (or all if fields is empty)
         to_compute = [f for f in stored_functions \
-                if ((not f[trigger_fields_]) or set(fields).intersection(f[trigger_fields_]))]
+                if ((not f[trigger_fields_]) or (not fields) or set(fields).intersection(f[trigger_fields_]))]
 
         mapping = {}
         for function in to_compute: