[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.
This commit is contained in:
parent
22bbfdaab1
commit
c58bf1e3bc
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue