[FIX] osv/orm: compute the _fct_inv() of stored functional fields at the record creation. Compute also the _fct_inv() of related fields (because there is no reason not to do it). That last patch revert a 'fix' of lp bug 544087 introduced in revision 4182, i don't get the purpose of it but that bug is not repdocutible anymore...

bzr revid: qdp-launchpad@openerp.com-20121017102821-tjx7gqiz86v7sn54
This commit is contained in:
Quentin (OpenERP) 2012-10-17 12:28:21 +02:00
parent a3cef23827
commit 38067dffc9
1 changed files with 5 additions and 2 deletions

View File

@ -4357,9 +4357,12 @@ class BaseModel(object):
upd0 = upd0 + ',"' + field + '"'
upd1 = upd1 + ',' + self._columns[field]._symbol_set[0]
upd2.append(self._columns[field]._symbol_set[1](vals[field]))
else:
if not isinstance(self._columns[field], fields.related):
#for the function fields that receive a value, we set them directly in the database
#(they may be required), but we also need to trigger the _fct_inv()
if (hasattr(self._columns[field], '_fnct_inv')):
upd_todo.append(field)
else:
upd_todo.append(field)
if field in self._columns \
and hasattr(self._columns[field], 'selection') \
and vals[field]: