[IMP] account_financial_report: Completes the functionality of hide_parent_hierarchy_level field and fix the level of accounts for trial balance
parent
310f79bbb1
commit
a201b356d0
|
@ -31,6 +31,8 @@
|
||||||
* Valentin Vinagre
|
* Valentin Vinagre
|
||||||
|
|
||||||
* Lois Rilo <lois.rilo@forgeflow.com>
|
* Lois Rilo <lois.rilo@forgeflow.com>
|
||||||
|
* Saran Lim. <saranl@ecosoft.co.th>
|
||||||
|
* Omar Castiñeira <omar@comunitea.com>
|
||||||
|
|
||||||
Much of the work in this module was done at a sprint in Sorrento, Italy in
|
Much of the work in this module was done at a sprint in Sorrento, Italy in
|
||||||
April 2016.
|
April 2016.
|
||||||
|
|
|
@ -46,8 +46,7 @@
|
||||||
<t t-foreach="trial_balance" t-as="balance">
|
<t t-foreach="trial_balance" t-as="balance">
|
||||||
<!-- Adapt -->
|
<!-- Adapt -->
|
||||||
<t t-set="style" t-value="'font-size:12px;'" />
|
<t t-set="style" t-value="'font-size:12px;'" />
|
||||||
<t t-if="show_hierarchy">
|
<t t-if="show_hierarchy and limit_hierarchy_level">
|
||||||
<t t-if="limit_hierarchy_level">
|
|
||||||
<t
|
<t
|
||||||
t-if="show_hierarchy_level > balance['level'] and (not hide_parent_hierarchy_level or (show_hierarchy_level - 1) == balance['level'])"
|
t-if="show_hierarchy_level > balance['level'] and (not hide_parent_hierarchy_level or (show_hierarchy_level - 1) == balance['level'])"
|
||||||
>
|
>
|
||||||
|
@ -56,7 +55,6 @@
|
||||||
/>
|
/>
|
||||||
</t>
|
</t>
|
||||||
</t>
|
</t>
|
||||||
</t>
|
|
||||||
<t t-else="">
|
<t t-else="">
|
||||||
<t
|
<t
|
||||||
t-call="account_financial_report.report_trial_balance_line"
|
t-call="account_financial_report.report_trial_balance_line"
|
||||||
|
|
|
@ -544,7 +544,9 @@ class TrialBalanceReport(models.AbstractModel):
|
||||||
account_group_relation = {}
|
account_group_relation = {}
|
||||||
for account in accounts:
|
for account in accounts:
|
||||||
accounts_data[account.id]["complete_code"] = (
|
accounts_data[account.id]["complete_code"] = (
|
||||||
account.group_id.complete_code if account.group_id.id else ""
|
account.group_id.complete_code + " / " + account.code
|
||||||
|
if account.group_id.id
|
||||||
|
else ""
|
||||||
)
|
)
|
||||||
if account.group_id.id:
|
if account.group_id.id:
|
||||||
if account.group_id.id not in account_group_relation.keys():
|
if account.group_id.id not in account_group_relation.keys():
|
||||||
|
|
|
@ -188,6 +188,7 @@ class TrialBalanceXslx(models.AbstractModel):
|
||||||
show_hierarchy_level = res_data["show_hierarchy_level"]
|
show_hierarchy_level = res_data["show_hierarchy_level"]
|
||||||
foreign_currency = res_data["foreign_currency"]
|
foreign_currency = res_data["foreign_currency"]
|
||||||
limit_hierarchy_level = res_data["limit_hierarchy_level"]
|
limit_hierarchy_level = res_data["limit_hierarchy_level"]
|
||||||
|
hide_parent_hierarchy_level = res_data["hide_parent_hierarchy_level"]
|
||||||
if not show_partner_details:
|
if not show_partner_details:
|
||||||
# Display array header for account lines
|
# Display array header for account lines
|
||||||
self.write_array_header(report_data)
|
self.write_array_header(report_data)
|
||||||
|
@ -195,15 +196,15 @@ class TrialBalanceXslx(models.AbstractModel):
|
||||||
# For each account
|
# For each account
|
||||||
if not show_partner_details:
|
if not show_partner_details:
|
||||||
for balance in trial_balance:
|
for balance in trial_balance:
|
||||||
if show_hierarchy:
|
if show_hierarchy and limit_hierarchy_level:
|
||||||
if limit_hierarchy_level:
|
if show_hierarchy_level > balance["level"] and (
|
||||||
if show_hierarchy_level > balance["level"]:
|
not hide_parent_hierarchy_level
|
||||||
|
or (show_hierarchy_level - 1) == balance["level"]
|
||||||
|
):
|
||||||
# Display account lines
|
# Display account lines
|
||||||
self.write_line_from_dict(balance, report_data)
|
self.write_line_from_dict(balance, report_data)
|
||||||
else:
|
else:
|
||||||
self.write_line_from_dict(balance, report_data)
|
self.write_line_from_dict(balance, report_data)
|
||||||
else:
|
|
||||||
self.write_line_from_dict(balance, report_data)
|
|
||||||
else:
|
else:
|
||||||
for account_id in total_amount:
|
for account_id in total_amount:
|
||||||
# Write account title
|
# Write account title
|
||||||
|
|
Loading…
Reference in New Issue