Browse Source

:Dec 04 [FIX] Bug Fixed 'dynamic_accounts_report'

18.0
Risvana Cybro 1 week ago
parent
commit
3b5ad32efb
  1. 1
      dynamic_accounts_report/__init__.py
  2. 2
      dynamic_accounts_report/__manifest__.py
  3. 22
      dynamic_accounts_report/controllers/__init__.py
  4. 71
      dynamic_accounts_report/controllers/controllers.py
  5. 5
      dynamic_accounts_report/doc/RELEASE_NOTES.md

1
dynamic_accounts_report/__init__.py

@ -19,5 +19,4 @@
# If not, see <http://www.gnu.org/licenses/>.
#
################################################################################
from . import controllers
from . import models

2
dynamic_accounts_report/__manifest__.py

@ -21,7 +21,7 @@
################################################################################
{
'name': 'Odoo18 Dynamic Accounting Reports',
'version': '18.0.1.2.5',
'version': '18.0.1.2.6',
'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"

22
dynamic_accounts_report/controllers/__init__.py

@ -1,22 +0,0 @@
# -*- coding: utf-8 -*-
################################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Bhagyadev KP (<https://www.cybrosys.com>)
#
# You can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
#
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
################################################################################
from . import controllers

71
dynamic_accounts_report/controllers/controllers.py

@ -1,71 +0,0 @@
# -*- coding: utf-8 -*-
################################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Bhagyadev KP (<https://www.cybrosys.com>)
#
# You can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
#
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
################################################################################
import json
from odoo import http
from odoo.http import content_disposition, request
from odoo.tools import html_escape
class XLSXReportController(http.Controller):
@http.route('/xlsx_report', type='http', auth='user', methods=['POST'],
csrf=False)
def get_report_xlsx(self, model, data, output_format, report_name,
report_action):
"""Generate an XLSX report based on the provided data and return it as
a response.
Args:
model (str): The name of the model on which the report is based.
data (str): The data required for generating the report.
output_format (str): The desired output format for the report
(e.g., 'xlsx').
report_name (str): The name to be given to the generated report
file.
Returns:
Response: The generated report file as a response.
Raises:
Exception: If an error occurs during report generation.
"""
uid = request.session.uid
report_obj = request.env[model].with_user(uid)
token = 'dummy-because-api-expects-one'
try:
if output_format == 'xlsx':
response = request.make_response(
None,
headers=[
('Content-Type', 'application/vnd.ms-excel'),
('Content-Disposition',
content_disposition(report_name + '.xlsx'))
]
)
report_obj.get_xlsx_report(data, response, report_name,
report_action)
response.set_cookie('fileToken', token)
return response
except Exception as e:
se = http.serialize_exception(e)
error = {
'code': 200,
'message': 'Odoo Server Error',
'data': se
}
return request.make_response(html_escape(json.dumps(error)))

5
dynamic_accounts_report/doc/RELEASE_NOTES.md

@ -29,3 +29,8 @@
#### Version 18.0.1.2.5
#### UPDT
- Bug Fixing in the accounting report (Trial Balance).
#### 03.12.2025
#### Version 18.0.1.2.6
#### BUG FIX
- Removed the controller for xlsx report generation which was already present in the dependent module base_accounting_kit.

Loading…
Cancel
Save