mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
[FIX] Reconciliation does not work due to browse record caching
This commit is contained in:
@@ -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
|
||||
|
||||
20
account_banking/browse_record.py
Normal file
20
account_banking/browse_record.py
Normal 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
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user