From 2dea00e826598ad79efe31bd578d05b5003a91e4 Mon Sep 17 00:00:00 2001 From: Cybrosys Technologies Date: Tue, 29 Jul 2025 20:13:12 +0530 Subject: [PATCH] July 29: [FIX]Bug fixed 'dynamic_accounts_report' --- dynamic_accounts_report/__manifest__.py | 2 +- dynamic_accounts_report/doc/RELEASE_NOTES.md | 8 +- .../models/account_trial_balance.py | 12 +- .../models/cash_book_report.py | 3 +- .../report/bank_book_templates.xml | 48 ++-- .../static/src/js/bank_flow.js | 2 +- .../static/src/js/trial_balance.js | 22 +- .../static/src/xml/trial_balance_view.xml | 240 ++++++++++++------ 8 files changed, 194 insertions(+), 143 deletions(-) diff --git a/dynamic_accounts_report/__manifest__.py b/dynamic_accounts_report/__manifest__.py index 967d2c973..ffb80ddea 100644 --- a/dynamic_accounts_report/__manifest__.py +++ b/dynamic_accounts_report/__manifest__.py @@ -21,7 +21,7 @@ ################################################################################ { 'name': 'Odoo18 Dynamic Accounting Reports', - 'version': '18.0.1.2.3', + 'version': '18.0.1.2.4', 'category': 'Accounting', 'summary': "Odoo 18 Accounting Financial Reports,Dynamic Accounting Reports, Dynamic Financial Reports,Dynamic Report Odoo18, Odoo18,Financial Reports, Odoo18 Accounting,Accounting, Odoo Apps", 'description': "This module creates dynamic Accounting General Ledger, Trial" diff --git a/dynamic_accounts_report/doc/RELEASE_NOTES.md b/dynamic_accounts_report/doc/RELEASE_NOTES.md index 63b677466..8d013e80d 100644 --- a/dynamic_accounts_report/doc/RELEASE_NOTES.md +++ b/dynamic_accounts_report/doc/RELEASE_NOTES.md @@ -18,4 +18,10 @@ #### 16.05.2025 #### Version 18.0.1.2.3 #### UPDT -- Bug Fixing and added thousand seperators \ No newline at end of file +- Bug Fixing and added thousand separators + +#### 28.07.2025 +#### Version 18.0.1.2.4 +#### UPDT +- Bug Fixing in the accounting report (Trial Balance). +- \ No newline at end of file diff --git a/dynamic_accounts_report/models/account_trial_balance.py b/dynamic_accounts_report/models/account_trial_balance.py index d3117e49b..3d765089e 100644 --- a/dynamic_accounts_report/models/account_trial_balance.py +++ b/dynamic_accounts_report/models/account_trial_balance.py @@ -115,6 +115,7 @@ class AccountTrialBalance(models.TransientModel): :return: List of dictionaries representing the financial report. :rtype: list """ + if options == {}: options = None if options is None: @@ -207,7 +208,7 @@ class AccountTrialBalance(models.TransientModel): domain = [('date', '>=', com_start_date), ('account_id', '=', account_id.id), ('date', '<=', com_end_date), - ('parent_state', 'in', option_domain), ] + ('parent_state', 'in', option_domain)] if journal_list: domain.append( ('journal_id', 'in', journal_list), ) @@ -243,15 +244,14 @@ class AccountTrialBalance(models.TransientModel): ('parent_state', 'in', option_domain), ] if journal_list: domain.append( - ('journal_id', 'in', journal_list), ) + ('journal_id', 'in', journal_list)) if analytic: domain.append( ('analytic_line_ids', 'in', analytic)) if method is not None and 'cash' in method: domain.append(('journal_id', 'in', self.env.company.tax_cash_basis_journal_id.ids)) - move_lines = self.env['account.move.line'].search( - domain) + move_lines = self.env['account.move.line'].search(domain) dynamic_date_num[ f"dynamic_date_num{i}"] = 'Q' + ' ' + str( get_quarter_number(com_start_date)) + ' ' + str( @@ -265,7 +265,7 @@ class AccountTrialBalance(models.TransientModel): domain = [('date', '>=', start_date), ('account_id', '=', account_id.id), ('date', '<=', end_date), - ('parent_state', 'in', option_domain), ] + ('parent_state', 'in', option_domain)] if journal_list: domain.append( ('journal_id', 'in', journal_list), ) @@ -449,4 +449,4 @@ class AccountTrialBalance(models.TransientModel): workbook.close() output.seek(0) response.stream.write(output.read()) - output.close() \ No newline at end of file + output.close() diff --git a/dynamic_accounts_report/models/cash_book_report.py b/dynamic_accounts_report/models/cash_book_report.py index 75db8e042..6501a5c80 100644 --- a/dynamic_accounts_report/models/cash_book_report.py +++ b/dynamic_accounts_report/models/cash_book_report.py @@ -191,8 +191,7 @@ class CashBookReport(models.TransientModel): lambda x: x.account_id.id == account['id']) move_line_data = move_lines.read( ['date', 'journal_id', 'partner_id', 'move_name', 'debit', - 'move_id', - 'credit', 'name', 'ref']) + 'move_id', 'credit', 'name', 'ref']) data[move_lines.mapped('account_id').display_name] = move_line_data currency_id = self.env.company.currency_id.symbol move_lines_total[move_lines.mapped('account_id').display_name] = { diff --git a/dynamic_accounts_report/report/bank_book_templates.xml b/dynamic_accounts_report/report/bank_book_templates.xml index cf9379086..8505880e4 100644 --- a/dynamic_accounts_report/report/bank_book_templates.xml +++ b/dynamic_accounts_report/report/bank_book_templates.xml @@ -117,9 +117,9 @@ - - @@ -127,17 +127,10 @@ - - - - - - - - - - - + + @@ -191,23 +184,18 @@ - - - - - - + + - - - - - - - + + @@ -223,15 +211,11 @@ Total - - - + - - - + diff --git a/dynamic_accounts_report/static/src/js/bank_flow.js b/dynamic_accounts_report/static/src/js/bank_flow.js index d097e7f5f..407fee1f6 100644 --- a/dynamic_accounts_report/static/src/js/bank_flow.js +++ b/dynamic_accounts_report/static/src/js/bank_flow.js @@ -140,7 +140,7 @@ class BankBook extends owl.Component { var self = this; let totals = { 'total_debit':this.state.total_debit, - 'total_debit_display':this.state.total_debit_display , + 'total_debit_display':this.state.total_debit_display, 'total_credit':this.state.total_credit, 'total_credit_display':this.state.total_credit_display, 'currency':this.state.currency, diff --git a/dynamic_accounts_report/static/src/js/trial_balance.js b/dynamic_accounts_report/static/src/js/trial_balance.js index c9014b12c..28942c8ca 100644 --- a/dynamic_accounts_report/static/src/js/trial_balance.js +++ b/dynamic_accounts_report/static/src/js/trial_balance.js @@ -2,7 +2,7 @@ const { Component } = owl; import { registry } from "@web/core/registry"; import { useService } from "@web/core/utils/hooks"; -import { useRef, useState } from "@odoo/owl"; +import { useRef, useState, useEffect } from "@odoo/owl"; import { BlockUI } from "@web/core/ui/block_ui"; import { download } from "@web/core/network/download"; const actionRegistry = registry.category("actions"); @@ -23,6 +23,7 @@ class TrialBalance extends owl.Component { this.unfoldButton = useRef('unfoldButton'); this.state = useState({ move_line: null, + default_report: true, data: null, total: null, journals: null, @@ -43,6 +44,7 @@ class TrialBalance extends owl.Component { }, }); this.load_data(self.initial_render = true); + } async load_data() { /** @@ -243,23 +245,8 @@ class TrialBalance extends owl.Component { } } this.state.data = await this.orm.call("account.trial.balance", "get_filter_values", [this.start_date.el.value, this.end_date.el.value, this.state.comparison_number, this.state.comparison_type, this.state.selected_journal_list, this.state.selected_analytic, this.state.options,this.state.method,]); + this.state.default_report = false var date_viewed = [] -// this.state.data.forEach((value, index) => { -// console.log(index) -// if (index == 'journal_ids') { -// this.state.journals = value -// console.log(this.state.journals) -// } -// if (value.dynamic_date_num) { -// let iterable = Array.isArray(value.dynamic_date_num) ? value.dynamic_date_num -// : Object.values(value.dynamic_date_num); -// for (const date_num of iterable) { -// if (!date_viewed.includes(date_num)) { -// date_viewed.push(date_num); -// } -// } -// } -// }) if (date_viewed.length !== 0) { this.state.date_viewed = date_viewed.reverse() } @@ -451,6 +438,7 @@ class TrialBalance extends owl.Component { } return filters } + async print_xlsx() { /** * Asynchronously generates and downloads an XLSX report. diff --git a/dynamic_accounts_report/static/src/xml/trial_balance_view.xml b/dynamic_accounts_report/static/src/xml/trial_balance_view.xml index 69b8ac617..ad738771b 100644 --- a/dynamic_accounts_report/static/src/xml/trial_balance_view.xml +++ b/dynamic_accounts_report/static/src/xml/trial_balance_view.xml @@ -310,116 +310,190 @@ - - - - - - - - - - - - - - - General Ledger + + + + + + + + + + + + -