From c58bf1e3bc40db83e0a922081008f6189e2bd2d4 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Wed, 4 Jun 2014 16:33:58 +0200 Subject: [PATCH] [FIX] account: better error message when regenarating opening entries (opw 606923) If we try to generate twice entries on the same fiscal year, we can get completly unrelated errors ("You can only reconcile journal items with the same partner"). With this, we make sure people will first cancel the entries before regeneraing the entries. --- addons/account/account_move_line.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index a7fd2adf33e..bdc1941238d 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -1030,6 +1030,8 @@ class account_move_line(osv.osv): all_moves = list(set(all_moves) - set(move_ids)) if unlink_ids: if opening_reconciliation: + raise osv.except_osv(_('Warning!'), + _('Opening Entries have already been generated. Please run "Cancel Closing Entries" wizard to cancel those entries and then run this wizard.')) obj_move_rec.write(cr, uid, unlink_ids, {'opening_reconciliation': False}) obj_move_rec.unlink(cr, uid, unlink_ids) if len(all_moves) >= 2: