[FIX] account: wizard of fiscal year closing fixed: the entries of all previous fiscal years have to be deffered, not only the last one

bzr revid: qdp@cyan-20100113163028-13qolk6d2jv5on2s
This commit is contained in:
Quentin De Paoli 2010-01-13 17:30:28 +01:00
parent b01c37956e
commit 9683d25c9b
1 changed files with 5 additions and 3 deletions

View File

@ -80,10 +80,12 @@ def _data_save(self, cr, uid, data, context):
if move_ids:
raise wizard.except_wizard(_('UserError'),
_('The opening journal must not have any entry in the new fiscal year !'))
query = "SELECT id FROM account_fiscalyear WHERE date_stop < '" + str(new_fyear.date_start) + "'"
cr.execute(query)
result = cr.dictfetchall()
fy_ids = ','.join([str(x['id']) for x in result])
query_line = pool.get('account.move.line')._query_get(cr, uid,
obj='account_move_line', context={'fiscalyear': fy_id})
obj='account_move_line', context={'fiscalyear': fy_ids})
cr.execute('select id from account_account WHERE active')
ids = map(lambda x: x[0], cr.fetchall())
for account in pool.get('account.account').browse(cr, uid, ids,