[FIX] account: prevent removing closing entries for closed period
As the target period is closed, should not be able to delete closing entries. opw 610428
This commit is contained in:
parent
3cae2c5155
commit
0a1f52ccb5
|
@ -38,6 +38,9 @@ class account_open_closed_fiscalyear(osv.osv_memory):
|
|||
if not period_journal:
|
||||
raise osv.except_osv(_('Error!'), _("You have to set the 'End of Year Entries Journal' for this Fiscal Year which is set after generating opening entries from 'Generate Opening Entries'."))
|
||||
|
||||
if period_journal.period_id.state == 'done':
|
||||
raise osv.except_osv(_('Error!'), _("You can not cancel closing entries if the 'End of Year Entries Journal' period is closed."))
|
||||
|
||||
ids_move = move_obj.search(cr, uid, [('journal_id','=',period_journal.journal_id.id),('period_id','=',period_journal.period_id.id)])
|
||||
if ids_move:
|
||||
cr.execute('delete from account_move where id IN %s', (tuple(ids_move),))
|
||||
|
|
Loading…
Reference in New Issue