Skip to content

Commit

Permalink
resolve rebase conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
luc-demeyer committed Nov 1, 2017
1 parent bdc1f31 commit 179543d
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 10 deletions.
14 changes: 9 additions & 5 deletions account_financial_report_webkit/report/common_balance_reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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,
Expand All @@ -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 = {}
Expand Down
5 changes: 4 additions & 1 deletion account_financial_report_webkit/report/general_ledger.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']

Expand Down Expand Up @@ -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 = {}
Expand Down
5 changes: 4 additions & 1 deletion account_financial_report_webkit/report/open_invoices.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}
Expand Down Expand Up @@ -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 = {}
Expand Down
5 changes: 4 additions & 1 deletion account_financial_report_webkit/report/partners_ledger.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 = {}
Expand Down

0 comments on commit 179543d

Please sign in to comment.