Stefan Rijnhart (Therp) has proposed merging lp:~banking-addons-team/banking-addons/6.0-lp942876-clear_browse_record_cache into lp:banking-addons.
Requested reviews: Grzegorz Grzelak (OpenGLOBE.pl) (grzegorz-og.pl): test Dmitrijs Ledkovs (credativ) (dle-credativ) Related bugs: Bug #942876 in Banking Addons: "6.0 reconciliation doesn't work" https://bugs.launchpad.net/banking-addons/+bug/942876 For more details, see: https://code.launchpad.net/~banking-addons-team/banking-addons/6.0-lp942876-clear_browse_record_cache/+merge/95151 The fix for lp:903929 introduces a browse record caching issue. This branch attempts to fix this issue by implementing a backport of the browse_record.refresh() method as suggested by Dmitrijs Ledkovs (https://bugs.launchpad.net/banking-addons/+bug/903929/comments/5). Note that this branch does not strictly apply to the new refractured 'interactive matching' branches which have a different workaround in place, but using the native 6.1 refresh() method does of course constitute a more elegant solution than that workaround. -- https://code.launchpad.net/~banking-addons-team/banking-addons/6.0-lp942876-clear_browse_record_cache/+merge/95151 Your team Banking Addons Team is subscribed to branch lp:~banking-addons-team/banking-addons/6.0-lp942876-clear_browse_record_cache.
=== modified file 'account_banking/__init__.py' --- account_banking/__init__.py 2010-02-03 23:36:03 +0000 +++ account_banking/__init__.py 2012-02-29 11:17:22 +0000 @@ -24,6 +24,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. # ############################################################################## +import browse_record import sepa import record import account_banking === added file 'account_banking/browse_record.py' --- account_banking/browse_record.py 1970-01-01 00:00:00 +0000 +++ account_banking/browse_record.py 2012-02-29 11:17:22 +0000 @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +from osv.orm import browse_record + +def refresh(self): + """ + This method taken from OpenERP 6.1. We use it to monkeypatch the + browse_record class with. Note that this affects the behaviour of the + OpenERP instance on all databases that it runs. + + Force refreshing this browse_record's data and all the data of the + records that belong to the same cache, by emptying the cache completely, + preserving only the record identifiers (for prefetching optimizations). + """ + for model, model_cache in self._cache.iteritems(): + # only preserve the ids of the records that were in the cache + cached_ids = dict([(i, {'id': i}) for i in model_cache.keys()]) + self._cache[model].clear() + self._cache[model].update(cached_ids) + +browse_record.refresh = refresh === modified file 'account_banking/wizard/bank_import.py' --- account_banking/wizard/bank_import.py 2012-02-11 11:39:02 +0000 +++ account_banking/wizard/bank_import.py 2012-02-29 11:17:22 +0000 @@ -102,6 +102,7 @@ 'line_id': [(6, 0, [move_line.id])], } ) + move_line.refresh() return retval def _link_payment(self, cursor, uid, trans, payment_lines,
-- Mailing list: https://launchpad.net/~credativ Post to : [email protected] Unsubscribe : https://launchpad.net/~credativ More help : https://help.launchpad.net/ListHelp

