[FIX] Account : Correction on closing fiscalyear:journal should be centralizaed and the boolean of skip draft state should be False

bzr revid: jvo@tinyerp.com-20101020134332-tzd7uf13nk4vigom
This commit is contained in:
Jay (OpenERP)
2010-10-20 19:13:32 +05:30
parent 358d1b2fe1
commit b42f8f310d
@@ -79,9 +79,9 @@ class account_fiscalyear_close(osv.osv_memory):
if not new_journal.default_credit_account_id or not new_journal.default_debit_account_id:
raise osv.except_osv(_('UserError'),
_('The journal must have default credit and debit account'))
if not new_journal.centralisation:
if (not new_journal.centralisation) or new_journal.entry_posted:
raise osv.except_osv(_('UserError'),
_('The journal must have centralised counterpart'))
_('The journal must have centralised counterpart without the Skipping draft state option checked!'))
move_ids = obj_acc_move_line.search(cr, uid, [
('journal_id', '=', new_journal.id), ('period_id.fiscalyear_id', '=', new_fyear.id)])