From d1b32490a646ba78458142f6667589e74a24e634 Mon Sep 17 00:00:00 2001 From: Matthieu Dietrich Date: Fri, 1 May 2015 13:21:59 +0200 Subject: [PATCH] Add context to account browse() methods (for translation) --- .../report/common_balance_reports.py | 5 ++--- .../report/common_partner_balance_reports.py | 5 ++--- account_financial_report_webkit/report/general_ledger.py | 5 ++--- account_financial_report_webkit/report/open_invoices.py | 5 ++--- account_financial_report_webkit/report/partners_ledger.py | 5 ++--- 5 files changed, 10 insertions(+), 15 deletions(-) diff --git a/account_financial_report_webkit/report/common_balance_reports.py b/account_financial_report_webkit/report/common_balance_reports.py index c3017e3b..bc2d2c04 100644 --- a/account_financial_report_webkit/report/common_balance_reports.py +++ b/account_financial_report_webkit/report/common_balance_reports.py @@ -278,9 +278,8 @@ class CommonBalanceReportHeaderWebkit(CommonReportHeaderWebkit): to_display = dict.fromkeys(account_ids, True) objects = [] - for account in self.pool.get('account.account').browse(self.cursor, - self.uid, - account_ids): + for account in self.pool.get('account.account').browse( + self.cursor, self.uid, account_ids, context=self.localcontext): if not account.parent_id: # hide top level account continue if account.type == 'consolidation': diff --git a/account_financial_report_webkit/report/common_partner_balance_reports.py b/account_financial_report_webkit/report/common_partner_balance_reports.py index 08cc3818..0be7f22b 100644 --- a/account_financial_report_webkit/report/common_partner_balance_reports.py +++ b/account_financial_report_webkit/report/common_partner_balance_reports.py @@ -280,9 +280,8 @@ class CommonPartnerBalanceReportHeaderWebkit(CommonBalanceReportHeaderWebkit, comp_accounts_by_ids.append(comparison_result) objects = [] - for account in self.pool.get('account.account').browse(self.cursor, - self.uid, - account_ids): + for account in self.pool.get('account.account').browse( + self.cursor, self.uid, account_ids, context=self.localcontext): if not account.parent_id: # hide top level account continue account.debit = accounts_by_ids[account.id]['debit'] diff --git a/account_financial_report_webkit/report/general_ledger.py b/account_financial_report_webkit/report/general_ledger.py index 0f62a270..15f68e9b 100644 --- a/account_financial_report_webkit/report/general_ledger.py +++ b/account_financial_report_webkit/report/general_ledger.py @@ -120,9 +120,8 @@ class GeneralLedgerWebkit(report_sxw.rml_parse, CommonReportHeaderWebkit): accounts, init_balance_memoizer, main_filter, target_move, start, stop) objects = [] - for account in self.pool.get('account.account').browse(self.cursor, - self.uid, - accounts): + for account in self.pool.get('account.account').browse( + self.cursor, self.uid, accounts, context=self.localcontext): if do_centralize and account.centralized \ and ledger_lines_memoizer.get(account.id): account.ledger_lines = self._centralize_lines( diff --git a/account_financial_report_webkit/report/open_invoices.py b/account_financial_report_webkit/report/open_invoices.py index 6ccdcbc1..a15652e2 100644 --- a/account_financial_report_webkit/report/open_invoices.py +++ b/account_financial_report_webkit/report/open_invoices.py @@ -146,9 +146,8 @@ class PartnersOpenInvoicesWebkit(report_sxw.rml_parse, account_ids, main_filter, target_move, start, stop, date_until, partner_filter=partner_ids) objects = [] - for account in self.pool.get('account.account').browse(self.cursor, - self.uid, - account_ids): + for account in self.pool.get('account.account').browse( + self.cursor, self.uid, account_ids, self.localcontext): account.ledger_lines = ledger_lines_memoizer.get(account.id, {}) account.init_balance = init_balance_memoizer.get(account.id, {}) # we have to compute partner order based on inital balance diff --git a/account_financial_report_webkit/report/partners_ledger.py b/account_financial_report_webkit/report/partners_ledger.py index ce5e1953..160b1ce2 100644 --- a/account_financial_report_webkit/report/partners_ledger.py +++ b/account_financial_report_webkit/report/partners_ledger.py @@ -147,9 +147,8 @@ class PartnersLedgerWebkit(report_sxw.rml_parse, accounts, main_filter, target_move, start, stop, partner_filter=partner_ids) objects = [] - for account in self.pool.get('account.account').browse(self.cursor, - self.uid, - accounts): + for account in self.pool.get('account.account').browse( + self.cursor, self.uid, accounts, context=self.localcontext): account.ledger_lines = ledger_lines.get(account.id, {}) account.init_balance = initial_balance_lines.get(account.id, {}) # we have to compute partner order based on inital balance