From 38067dffc9be8a14010118132c622f3749a7edc0 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Wed, 17 Oct 2012 12:28:21 +0200 Subject: [PATCH] [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 --- openerp/osv/orm.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/openerp/osv/orm.py b/openerp/osv/orm.py index 62d12ef20ee..1db2feeca88 100644 --- a/openerp/osv/orm.py +++ b/openerp/osv/orm.py @@ -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]: