Nimesh Contractor(Open ERP) has proposed merging
lp:~openerp-dev/openobject-server/trunk-bug-789576-nco into
lp:openobject-server.
Requested reviews:
Naresh(OpenERP) (nch-openerp)
Related bugs:
Bug #789576 in OpenERP Server: "fields.related override: store function
persists"
https://bugs.launchpad.net/openobject-server/+bug/789576
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-server/trunk-bug-789576-nco/+merge/65303
Hello sir,
When a fields.related is overridden by a regular field, the store function
is not removed.
Thank you.
--
https://code.launchpad.net/~openerp-dev/openobject-server/trunk-bug-789576-nco/+merge/65303
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-server/trunk-bug-789576-nco.
=== modified file 'openerp/osv/orm.py'
--- openerp/osv/orm.py 2011-06-19 11:57:01 +0000
+++ openerp/osv/orm.py 2011-06-21 07:01:24 +0000
@@ -3041,9 +3041,12 @@
f = self._columns[store_field]
if hasattr(f, 'digits_change'):
f.digits_change(cr)
- if not isinstance(f, fields.function):
- continue
- if not f.store:
+ if not isinstance(f, fields.function) or not f.store:
+ # remove store functions of overridden fields
+ fncts = self.pool._store_function.get(self._name, [])
+ for x, y, z, e, f, l in fncts:
+ if (x==self._name) and (y==store_field):
+ fncts.remove((x, y, z, e, f, l))
continue
if self._columns[store_field].store is True:
sm = {self._name: (lambda self, cr, uid, ids, c={}: ids, None, 10, None)}
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp