From 179543df104b99268b95d8c4f164a47715edfc4c Mon Sep 17 00:00:00 2001 From: luc-demeyer Date: Wed, 1 Nov 2017 19:48:10 +0100 Subject: [PATCH] resolve rebase conflict --- .../report/common_balance_reports.py | 14 +++++++++----- .../report/common_partner_balance_reports.py | 7 +++++-- .../report/general_ledger.py | 5 ++++- .../report/open_invoices.py | 5 ++++- .../report/partners_ledger.py | 5 ++++- 5 files changed, 26 insertions(+), 10 deletions(-) diff --git a/account_financial_report_webkit/report/common_balance_reports.py b/account_financial_report_webkit/report/common_balance_reports.py index 2e09e6d3e99..df0591d4d3f 100644 --- a/account_financial_report_webkit/report/common_balance_reports.py +++ b/account_financial_report_webkit/report/common_balance_reports.py @@ -124,7 +124,7 @@ def _get_account_details(self, account_ids, target_move, fiscalyear, return accounts_by_id def _get_comparison_details(self, data, account_ids, target_move, - comparison_filter, index): + comparison_filter, index, context=None): """ @param data: data of the wizard form @@ -161,7 +161,7 @@ def _get_comparison_details(self, data, account_ids, target_move, and self._get_initial_balance_mode(start) or False accounts_by_ids = self._get_account_details( account_ids, target_move, fiscalyear, details_filter, - start, stop, initial_balance_mode) + start, stop, initial_balance_mode, context=context) comp_params = { 'comparison_filter': comparison_filter, 'fiscalyear': fiscalyear, @@ -237,6 +237,8 @@ def _get_start_stop_for_filter(self, main_filter, fiscalyear, start_date, return start_period, stop_period, start, stop def compute_balance_data(self, data, filter_report_type=None): + lang = self.localcontext.get('lang') + lang_ctx = lang and {'lang': lang} or {} new_ids = (data['form']['account_ids'] or [data['form']['chart_account_id']]) max_comparison = self._get_form_param( @@ -276,20 +278,22 @@ def compute_balance_data(self, data, filter_report_type=None): # get details for each account, total of debit / credit / balance accounts_by_ids = self._get_account_details( account_ids, target_move, fiscalyear, main_filter, start, stop, - initial_balance_mode) + initial_balance_mode, context=lang_ctx) comparison_params = [] comp_accounts_by_ids = [] for index in range(max_comparison): if comp_filters[index] != 'filter_no': comparison_result, comp_params = self._get_comparison_details( - data, account_ids, target_move, comp_filters[index], index) + data, account_ids, target_move, comp_filters[index], index, + context=lang_ctx) comparison_params.append(comp_params) comp_accounts_by_ids.append(comparison_result) objects = self.pool.get('account.account').browse(self.cursor, self.uid, - account_ids) + account_ids, + context=lang_ctx) to_display_accounts = dict.fromkeys(account_ids, True) init_balance_accounts = dict.fromkeys(account_ids, False) 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 5139ad5e387..41a322329ca 100644 --- a/account_financial_report_webkit/report/common_partner_balance_reports.py +++ b/account_financial_report_webkit/report/common_partner_balance_reports.py @@ -232,6 +232,8 @@ def _get_partners_comparison_details(self, data, account_ids, target_move, return accounts_details_by_ids, comp_params def compute_partner_balance_data(self, data, filter_report_type=None): + lang = self.localcontext.get('lang') + lang_ctx = lang and {'lang': lang} or {} new_ids = data['form']['account_ids'] or data[ 'form']['chart_account_id'] max_comparison = self._get_form_param( @@ -271,7 +273,7 @@ def compute_partner_balance_data(self, data, filter_report_type=None): # get details for each accounts, total of debit / credit / balance accounts_by_ids = self._get_account_details( account_ids, target_move, fiscalyear, main_filter, start, stop, - initial_balance_mode) + initial_balance_mode, context=lang_ctx) partner_details_by_ids = self._get_account_partners_details( accounts_by_ids, main_filter, target_move, start, stop, @@ -293,7 +295,8 @@ def compute_partner_balance_data(self, data, filter_report_type=None): comp_accounts_by_ids.append(comparison_result) objects = self.pool.get('account.account').browse(self.cursor, self.uid, - account_ids) + account_ids, + context=lang_ctx) init_balance_accounts = {} comparisons_accounts = {} diff --git a/account_financial_report_webkit/report/general_ledger.py b/account_financial_report_webkit/report/general_ledger.py index b91273c8454..11a09a85894 100644 --- a/account_financial_report_webkit/report/general_ledger.py +++ b/account_financial_report_webkit/report/general_ledger.py @@ -75,6 +75,8 @@ def __init__(self, cursor, uid, name, context): def set_context(self, objects, data, ids, report_type=None): """Populate a ledger_lines attribute on each browse record that will be used by mako template""" + lang = self.localcontext.get('lang') + lang_ctx = lang and {'lang': lang} or {} new_ids = data['form']['account_ids'] or data[ 'form']['chart_account_id'] @@ -121,7 +123,8 @@ def set_context(self, objects, data, ids, report_type=None): stop) objects = self.pool.get('account.account').browse(self.cursor, self.uid, - accounts) + accounts, + context=lang_ctx) init_balance = {} ledger_lines = {} diff --git a/account_financial_report_webkit/report/open_invoices.py b/account_financial_report_webkit/report/open_invoices.py index 07fd92e7b7e..45ebadb038f 100644 --- a/account_financial_report_webkit/report/open_invoices.py +++ b/account_financial_report_webkit/report/open_invoices.py @@ -102,6 +102,8 @@ def _group_lines_by_currency(self, account_br, ledger_lines): def set_context(self, objects, data, ids, report_type=None): """Populate a ledger_lines attribute on each browse record that will be used by mako template""" + lang = self.localcontext.get('lang') + lang_ctx = lang and {'lang': lang} or {} new_ids = data['form']['chart_account_id'] # Account initial balance memoizer init_balance_memoizer = {} @@ -148,7 +150,8 @@ def set_context(self, objects, data, ids, report_type=None): partner_filter=partner_ids) objects = self.pool.get('account.account').browse(self.cursor, self.uid, - account_ids) + account_ids, + context=lang_ctx) ledger_lines = {} init_balance = {} diff --git a/account_financial_report_webkit/report/partners_ledger.py b/account_financial_report_webkit/report/partners_ledger.py index 7ddca6b580c..9ed891640e6 100644 --- a/account_financial_report_webkit/report/partners_ledger.py +++ b/account_financial_report_webkit/report/partners_ledger.py @@ -86,6 +86,8 @@ def _get_initial_balance_mode(self, start_period): def set_context(self, objects, data, ids, report_type=None): """Populate a ledger_lines attribute on each browse record that will be used by mako template""" + lang = self.localcontext.get('lang') + lang_ctx = lang and {'lang': lang} or {} new_ids = data['form']['chart_account_id'] # account partner memoizer @@ -148,7 +150,8 @@ def set_context(self, objects, data, ids, report_type=None): partner_filter=partner_ids) objects = self.pool.get('account.account').browse(self.cursor, self.uid, - accounts) + accounts, + context=lang_ctx) init_balance = {} ledger_lines_dict = {}