From 651f8f8994311a7161dc09246400cae77634966e Mon Sep 17 00:00:00 2001 From: "Mayur Maheshwari (OpenERP)" Date: Thu, 1 Nov 2012 15:27:54 +0530 Subject: [PATCH] [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 --- addons/account/wizard/account_fiscalyear_close.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/account/wizard/account_fiscalyear_close.py b/addons/account/wizard/account_fiscalyear_close.py index 196c14d3792..5880fb2d31f 100644 --- a/addons/account/wizard/account_fiscalyear_close.py +++ b/addons/account/wizard/account_fiscalyear_close.py @@ -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']