Mayur Maheshwari(OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-opw-576210-port-mma into 
lp:openobject-addons.

Requested reviews:
  OpenERP Core Team (openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-opw-576210-port-mma/+merge/132490

Hello,

If you pay foreign currency invoices with foreign currency, it will generate 
debit and credit entry with amount 0.0. Due to this, Generate Opening Entries" 
wizard generates credit and debit entries with amount 0.0 at the time of 
balance transfer before closing the year.

   This fixes the issue.
   Code is forward port from 6.1

Thanks,
Mayur
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-opw-576210-port-mma/+merge/132490
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-opw-576210-port-mma.
=== modified file 'account/wizard/account_fiscalyear_close.py'
--- account/wizard/account_fiscalyear_close.py	2012-08-07 11:34:14 +0000
+++ account/wizard/account_fiscalyear_close.py	2012-11-01 10:00:41 +0000
@@ -226,8 +226,9 @@
         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']

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to