Comment 3 for bug 740132

Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

It seems like a possible solution is the one line below, and removing references to abs() from the balance sheet rml files when applied to account balances (not balance sheet totals). That leaves modifying the sxw source files, of course

--- account/report/account_balance_sheet.py 2011-01-14 00:11:01 +0000
+++ account/report/account_balance_sheet.py 2011-03-22 12:19:20 +0000
@@ -130,38 +130,40 @@
             accounts_temp = []
             for account in accounts:
                 if (account.user_type.report_type) and (account.user_type.report_type == typ):
                     account_dict = {
                         'id': account.id,
                         'code': account.code,
                         'name': account.name,
                         'level': account.level,
- 'balance':account.balance,
+ 'balance': (account.balance and typ == 'liability' and -1 or 1 ) * account.balance,
                     }
                     currency = account.currency_id and account.currency_id or account.company_id.currency_id
                     if typ == 'liability' and account.type <> 'view' and (account.debit <> account.credit):
                         self.result_sum_dr += account.balance
                     if typ == 'asset' and account.type <> 'view' and (account.debit <> account.credit):
                         self.result_sum_cr += account.balance
                     if data['form']['display_account'] == 'bal_movement':