From 365eb138b445aaf7086502d16255f04d104d1adf Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Tue, 7 Apr 2015 11:54:53 +0200 Subject: [PATCH] [FIX] account: set reconciliation reference for opening entries When opening entries are generated, the reconcile_id field is updated in SQL (probably for performances reasons) but the computed and stored field reconcile_ref is not recomputed by the ORM. Force the recomputation of the field by calling ORM method _store_set_values. Fixes #4267, opw 620369 --- addons/account/wizard/account_fiscalyear_close.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/account/wizard/account_fiscalyear_close.py b/addons/account/wizard/account_fiscalyear_close.py index e044e603207..57f43964c8f 100644 --- a/addons/account/wizard/account_fiscalyear_close.py +++ b/addons/account/wizard/account_fiscalyear_close.py @@ -62,6 +62,8 @@ class account_fiscalyear_close(osv.osv_memory): raise osv.except_osv(_('Warning!'), _('The entries to reconcile should belong to the same company.')) r_id = self.pool.get('account.move.reconcile').create(cr, uid, {'type': 'auto', 'opening_reconciliation': True}) cr.execute('update account_move_line set reconcile_id = %s where id in %s',(r_id, tuple(ids),)) + # reconcile_ref deptends from reconcile_id but was not recomputed + obj_acc_move_line._store_set_values(cr, uid, ids, ['reconcile_ref'], context=context) obj_acc_move_line.invalidate_cache(cr, uid, ['reconcile_id'], ids, context=context) return r_id