Browse Source

May 16: [FIX] Bug Fixed 'dynamic_accounts_report'

pull/317/head
RisvanaCybro 1 year ago
parent
commit
58572d67e5
  1. 2
      dynamic_accounts_report/__manifest__.py
  2. 4
      dynamic_accounts_report/models/dynamic_balance_sheet_report.py
  3. 186
      dynamic_accounts_report/report/balance_sheet_report_templates.xml
  4. 3
      dynamic_accounts_report/static/src/xml/balance_sheet_template.xml

2
dynamic_accounts_report/__manifest__.py

@ -21,7 +21,7 @@
################################################################################
{
'name': 'Odoo17 Dynamic Accounting Reports',
'version': '17.0.1.0.0',
'version': '17.0.1.0.1',
'category': 'Accounting',
'summary': "Odoo 17 Accounting Financial Reports,Dynamic Accounting Reports, Dynamic Financial Reports,Dynamic Report Odoo17, Odoo17,Financial Reports, Odoo17 Accounting,Accounting, Odoo Apps",
'description': "This module creates dynamic Accounting General Ledger, Trial"

4
dynamic_accounts_report/models/dynamic_balance_sheet_report.py

@ -303,13 +303,13 @@ class ProfitLossReport(models.TransientModel):
amount = sum(filtered_lines.mapped('debit')) - sum(
filtered_lines.mapped('credit'))
entries.append({
'name': "{} - {}".format(account.root_id.id, account.name),
'name': "{} - {}".format(account.code, account.name),
'amount': "{:,.2f}".format(amount),
})
total += amount
else:
entries.append({
'name': "{} - {}".format(account.root_id.id, account.name),
'name': "{} - {}".format(account.code, account.name),
'amount': "{:,.2f}".format(0),
})
return entries, "{:,.2f}".format(total)

186
dynamic_accounts_report/report/balance_sheet_report_templates.xml

@ -6,6 +6,7 @@
<template id="dynamic_accounts_report.balance_sheet">
<t t-call="web.html_container">
<t t-call="web.external_layout">
<t t-set="data_report_dpi" t-value="110"/>
<div class="page">
<h3>
@ -73,54 +74,33 @@
</th>
</t>
</tr>
<t t-foreach="data['datas']" t-as="value"
t-key="value_index">
<t t-if="value_index == 0">
<t t-foreach="value['asset_cash'][0]"
t-as="datas" t-key="datas_index">
<t t-set="account_name"
t-value="datas['name']"/>
<t t-set="account_value" t-value="0"/>
<t t-foreach="data['datas'][0]['asset_cash'][0]"
t-as="datas" t-key="datas_index">
<t t-if="datas['amount'] != '0.00'">
<tr style="border-bottom: 1px solid gainsboro;">
<th colspan="6"
style="font-weight: normal;">
<span style="margin-left: 8%;">
<t t-esc="datas['name']"/>
</span>
</th>
<!-- Assuming you want to iterate over all values to display -->
<t t-foreach="data['datas']"
t-as="values"
t-key="values_index">
t-as="values" t-key="values_index">
<t t-foreach="values['asset_cash'][0]"
t-as="datas" t-key="datas_index">
<t t-if="account_name == datas['name']">
<t t-if="datas['amount'] != '0.00'">
<t t-set="account_value"
t-value="1"/>
</t>
t-as="account"
t-key="account_index">
<t t-if="account['name'] == datas['name']">
<th class="text-end"
style="font-weight: normal;">
<span>
<t t-esc="account['amount']"/>
</span>
</th>
</t>
</t>
</t>
<t t-if="account_value == 1">
<tr style="border-bottom: 1px solid gainsboro;">
<th colspan="6"
style="font-weight: normal;">
<span style="margin-left: 8%;">
<t t-esc="datas['name']"/>
</span>
</th>
<t t-foreach="data['datas']"
t-as="values"
t-key="values_index">
<t t-foreach="values['asset_cash'][0]"
t-as="datas"
t-key="datas_index">
<t t-if="account_name == datas['name']">
<th class="text-end"
style="font-weight: normal;">
<span>
<t t-esc="datas['amount']"/>
</span>
</th>
</t>
</t>
</t>
</tr>
</t>
</t>
</tr>
</t>
</t>
<tr style="border-bottom: 1px solid gainsboro;">
@ -161,12 +141,6 @@
</t>
<t t-if="account_value == 1">
<tr style="border-bottom: 1px solid gainsboro;">
<th colspan="6"
style="font-weight: normal;">
<span style="margin-left: 8%;">
<t t-esc="datas['name']"/>
</span>
</th>
<t t-foreach="data['datas']"
t-as="values"
t-key="values_index">
@ -174,6 +148,12 @@
t-as="datas"
t-key="datas_index">
<t t-if="account_name == datas['name']">
<th colspan="6"
style="font-weight: normal;">
<span style="margin-left: 8%;">
<t t-esc="datas['name']"/>
</span>
</th>
<th class="text-end"
style="font-weight: normal;">
<span>
@ -227,12 +207,6 @@
</t>
<t t-if="account_value == 1">
<tr style="border-bottom: 1px solid gainsboro;">
<th colspan="6"
style="font-weight: normal;">
<span style="margin-left: 8%;">
<t t-esc="datas['name']"/>
</span>
</th>
<t t-foreach="data['datas']"
t-as="values"
t-key="values_index">
@ -240,6 +214,12 @@
t-as="datas"
t-key="datas_index">
<t t-if="account_name == datas['name']">
<th colspan="6"
style="font-weight: normal;">
<span style="margin-left: 8%;">
<t t-esc="datas['name']"/>
</span>
</th>
<th class="text-end"
style="font-weight: normal;">
<span>
@ -292,12 +272,6 @@
</t>
<t t-if="account_value == 1">
<tr style="border-bottom: 1px solid gainsboro;">
<th colspan="6"
style="font-weight: normal;">
<span style="margin-left: 8%;">
<t t-esc="datas['name']"/>
</span>
</th>
<t t-foreach="data['datas']"
t-as="values"
t-key="values_index">
@ -305,6 +279,12 @@
t-as="datas"
t-key="datas_index">
<t t-if="account_name == datas['name']">
<th colspan="6"
style="font-weight: normal;">
<span style="margin-left: 8%;">
<t t-esc="datas['name']"/>
</span>
</th>
<th class="text-end"
style="font-weight: normal;">
<span>
@ -373,12 +353,6 @@
</t>
<t t-if="account_value == 1">
<tr style="border-bottom: 1px solid gainsboro;">
<th colspan="6"
style="font-weight: normal;">
<span style="margin-left: 8%;">
<t t-esc="datas['name']"/>
</span>
</th>
<t t-foreach="data['datas']"
t-as="values"
t-key="values_index">
@ -386,6 +360,12 @@
t-as="datas"
t-key="datas_index">
<t t-if="account_name == datas['name']">
<th colspan="6"
style="font-weight: normal;">
<span style="margin-left: 8%;">
<t t-esc="datas['name']"/>
</span>
</th>
<th class="text-end"
style="font-weight: normal;">
<span>
@ -439,12 +419,6 @@
</t>
<t t-if="account_value == 1">
<tr style="border-bottom: 1px solid gainsboro;">
<th colspan="6"
style="font-weight: normal;">
<span style="margin-left: 8%;">
<t t-esc="datas['name']"/>
</span>
</th>
<t t-foreach="data['datas']"
t-as="values"
t-key="values_index">
@ -452,6 +426,12 @@
t-as="datas"
t-key="datas_index">
<t t-if="account_name == datas['name']">
<th colspan="6"
style="font-weight: normal;">
<span style="margin-left: 8%;">
<t t-esc="datas['name']"/>
</span>
</th>
<th class="text-end"
style="font-weight: normal;">
<span>
@ -536,12 +516,6 @@
</t>
<t t-if="account_value == 1">
<tr style="border-bottom: 1px solid gainsboro;">
<th colspan="6"
style="font-weight: normal;">
<span style="margin-left: 8%;">
<t t-esc="datas['name']"/>
</span>
</th>
<t t-foreach="data['datas']"
t-as="values"
t-key="values_index">
@ -549,6 +523,12 @@
t-as="datas"
t-key="datas_index">
<t t-if="account_name == datas['name']">
<th colspan="6"
style="font-weight: normal;">
<span style="margin-left: 8%;">
<t t-esc="datas['name']"/>
</span>
</th>
<th class="text-end"
style="font-weight: normal;">
<span>
@ -601,12 +581,6 @@
</t>
<t t-if="account_value == 1">
<tr style="border-bottom: 1px solid gainsboro;">
<th colspan="6"
style="font-weight: normal;">
<span style="margin-left: 8%;">
<t t-esc="datas['name']"/>
</span>
</th>
<t t-foreach="data['datas']"
t-as="values"
t-key="values_index">
@ -614,6 +588,12 @@
t-as="datas"
t-key="datas_index">
<t t-if="account_name == datas['name']">
<th colspan="6"
style="font-weight: normal;">
<span style="margin-left: 8%;">
<t t-esc="datas['name']"/>
</span>
</th>
<th class="text-end"
style="font-weight: normal;">
<span>
@ -682,12 +662,6 @@
</t>
<t t-if="account_value == 1">
<tr style="border-bottom: 1px solid gainsboro;">
<th colspan="6"
style="font-weight: normal;">
<span style="margin-left: 8%;">
<t t-esc="datas['name']"/>
</span>
</th>
<t t-foreach="data['datas']"
t-as="values"
t-key="values_index">
@ -695,6 +669,12 @@
t-as="datas"
t-key="datas_index">
<t t-if="account_name == datas['name']">
<th colspan="6"
style="font-weight: normal;">
<span style="margin-left: 8%;">
<t t-esc="datas['name']"/>
</span>
</th>
<th class="text-end"
style="font-weight: normal;">
<span>
@ -795,12 +775,6 @@
</t>
<t t-if="account_value == 1">
<tr style="border-bottom: 1px solid gainsboro;">
<th colspan="6"
style="font-weight: normal;">
<span style="margin-left: 8%;">
<t t-esc="datas['name']"/>
</span>
</th>
<t t-foreach="data['datas']"
t-as="values"
t-key="values_index">
@ -808,6 +782,12 @@
t-as="datas"
t-key="datas_index">
<t t-if="account_name == datas['name']">
<th colspan="6"
style="font-weight: normal;">
<span style="margin-left: 8%;">
<t t-esc="datas['name']"/>
</span>
</th>
<th class="text-end"
style="font-weight: normal;">
<span>
@ -876,12 +856,6 @@
</t>
<t t-if="account_value == 1">
<tr style="border-bottom: 1px solid gainsboro;">
<th colspan="6"
style="font-weight: normal;">
<span style="margin-left: 8%;">
<t t-esc="datas['name']"/>
</span>
</th>
<t t-foreach="data['datas']"
t-as="values"
t-key="values_index">
@ -889,6 +863,12 @@
t-as="datas"
t-key="datas_index">
<t t-if="account_name == datas['name']">
<th colspan="6"
style="font-weight: normal;">
<span style="margin-left: 8%;">
<t t-esc="datas['name']"/>
</span>
</th>
<th class="text-end"
style="font-weight: normal;">
<span>

3
dynamic_accounts_report/static/src/xml/balance_sheet_template.xml

@ -1147,8 +1147,7 @@
<t t-else="">
<tr class="border-bottom border-gainsboro">
<th colspan="9">
<span class="ms-4">Plus
Non-current Assets
<span class="ms-4">Current Liabilities
</span>
</th>
</tr>

Loading…
Cancel
Save