From 87f62cf105e4e4632f0f60d7d1be0b517ffc078f Mon Sep 17 00:00:00 2001 From: AjmalCybro Date: Mon, 17 Mar 2025 14:19:22 +0530 Subject: [PATCH] Mar 17 : [UPDT] Updated 'dynamic_accounts_report' --- .../models/dynamic_balance_sheet_report.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/dynamic_accounts_report/models/dynamic_balance_sheet_report.py b/dynamic_accounts_report/models/dynamic_balance_sheet_report.py index cf04c8e76..486d46e38 100644 --- a/dynamic_accounts_report/models/dynamic_balance_sheet_report.py +++ b/dynamic_accounts_report/models/dynamic_balance_sheet_report.py @@ -3,8 +3,8 @@ # # Cybrosys Technologies Pvt. Ltd. # -# Copyright (C) 2024-TODAY Cybrosys Technologies() -# Author: Bhagyadev KP () +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Ammu Raj (odoo@cybrosys.com) # # You can modify it under the terms of the GNU LESSER # GENERAL PUBLIC LICENSE (LGPL v3), Version 3. @@ -195,10 +195,13 @@ class ProfitLossReport(models.TransientModel): **account_entries} datas.append(data) else: + current_year = fields.Date.today().year + date_from = financial_report_id.date_from or f'{current_year}-01-01' + date_to = financial_report_id.date_to or f'{current_year}-12-31' account_move_lines = self.env['account.move.line'].search( [('parent_state', 'in', target_move), - ('date', '>=', f'{current_year}-01-01'), - ('date', '<=', f'{current_year}-12-31')]) + ('date', '>=', date_from), + ('date', '<=', date_to)]) lists = [{'id': rec.id, 'value': [eval(i) for i in rec.analytic_distribution.keys()]}