[FIX] Reconciliation does not work due to browse record caching

This commit is contained in:
Stefan Rijnhart
2012-03-09 11:52:53 +01:00
3 changed files with 22 additions and 0 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -102,6 +102,7 @@ class banking_import(osv.osv_memory):
'line_id': [(6, 0, [move_line.id])],
}
)
move_line.refresh()
return retval
def _link_payment(self, cursor, uid, trans, payment_lines,