From 09bc991004d34bf0b5d8d0fe70dbc37d3bd425b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Mon, 24 Nov 2014 18:26:17 +0100 Subject: [PATCH 1/2] [FIX] webkit: trial balance fix migration bugs --- .../report/common_balance_reports.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/account_financial_report_webkit/report/common_balance_reports.py b/account_financial_report_webkit/report/common_balance_reports.py index 3d3be9ac..c84bb5c4 100644 --- a/account_financial_report_webkit/report/common_balance_reports.py +++ b/account_financial_report_webkit/report/common_balance_reports.py @@ -94,7 +94,7 @@ class CommonBalanceReportHeaderWebkit(CommonReportHeaderWebkit): account_ids, ['type', 'code', 'name', 'debit', 'credit', 'balance', 'parent_id', 'level', 'child_id'], - ctx) + context=ctx) accounts_by_id = {} for account in accounts: @@ -296,11 +296,11 @@ class CommonBalanceReportHeaderWebkit(CommonReportHeaderWebkit): elif account.type == 'view': to_display_accounts.update( dict([(a.id, True) for a in account.child_id])) - debit_accounts['account_id'] = \ + debit_accounts[account.id] = \ accounts_by_ids[account.id]['debit'] - credit_accounts['account_id'] = \ + credit_accounts[account.id] = \ accounts_by_ids[account.id]['credit'] - balance_accounts['account_id'] = \ + balance_accounts[account.id] = \ accounts_by_ids[account.id]['balance'] init_balance_accounts[account.id] = \ accounts_by_ids[account.id].get('init_balance', 0.0) @@ -324,8 +324,9 @@ class CommonBalanceReportHeaderWebkit(CommonReportHeaderWebkit): # we set it as a property to let the data in the report if someone # want to use it in a custom report display_account = display_account\ - or any((account.debit, - account.credit, account.balance, + or any((debit_accounts[account.id], + credit_accounts[account.id], + balance_accounts[account.id], init_balance_accounts[account.id])) to_display_accounts.update( {account.id: display_account and From 7da94789256cd752664719cb023636e6371ca7ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Mon, 24 Nov 2014 18:48:56 +0100 Subject: [PATCH 2/2] [FIX] pylint --- account_financial_report_webkit/report/print_journal.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/account_financial_report_webkit/report/print_journal.py b/account_financial_report_webkit/report/print_journal.py index c2b2f247..60a4c61f 100644 --- a/account_financial_report_webkit/report/print_journal.py +++ b/account_financial_report_webkit/report/print_journal.py @@ -28,8 +28,8 @@ from openerp.tools.translate import _ from openerp import pooler from datetime import datetime -from common_reports import CommonReportHeaderWebkit -from webkit_parser_header_fix import HeaderFooterTextWebKitParser +from .common_reports import CommonReportHeaderWebkit +from .webkit_parser_header_fix import HeaderFooterTextWebKitParser class PrintJournalWebkit(report_sxw.rml_parse, CommonReportHeaderWebkit):