[FIX]account : Generate Opening Entries wizard should not generate credit and debit entries with amount 0.0 at the time of balance transfer before closing the year

bzr revid: mma@tinyerp.com-20121101095754-rczv2nvmk0mdqsdb
This commit is contained in:
Mayur Maheshwari (OpenERP) 2012-11-01 15:27:54 +05:30
parent b006809773
commit 651f8f8994
1 changed files with 2 additions and 1 deletions

View File

@ -226,8 +226,9 @@ class account_fiscalyear_close(osv.osv_memory):
for account in obj_acc_account.browse(cr, uid, account_ids, context={'fiscalyear': fy_id}):
balance_in_currency = 0.0
if account.currency_id:
cr.execute('SELECT sum(amount_currency) as balance_in_currency FROM account_move_line ' \
cr.execute('SELECT COALESCE(sum(amount_currency),0.0) as balance_in_currency FROM account_move_line ' \
'WHERE account_id = %s ' \
'AND (debit <> 0.0 and credit <> 0.0) ' \
'AND ' + query_line + ' ' \
'AND currency_id = %s', (account.id, account.currency_id.id))
balance_in_currency = cr.dictfetchone()['balance_in_currency']