Browse Source

:Dec 04 [FIX] Bug Fixed 'base_accounting_kit'

pull/396/merge
Risvana Cybro 2 weeks ago
parent
commit
32f8a6e3d5
  1. 2
      base_accounting_kit/__manifest__.py
  2. 45
      base_accounting_kit/controllers/statement_report.py
  3. 5
      base_accounting_kit/doc/RELEASE_NOTES.md

2
base_accounting_kit/__manifest__.py

@ -21,7 +21,7 @@
############################################################################# #############################################################################
{ {
'name': 'Odoo 18 Full Accounting Kit for Community', 'name': 'Odoo 18 Full Accounting Kit for Community',
'version': '18.0.5.0.7', 'version': '18.0.5.0.8',
'category': 'Accounting', 'category': 'Accounting',
'live_test_url': 'https://kit.easyinstance.com/web/login?redirect=/odoo/accounting', 'live_test_url': 'https://kit.easyinstance.com/web/login?redirect=/odoo/accounting',
'summary': """Odoo 18 Accounting, Odoo 18 Accounting Reports, Odoo18 Accounting, Odoo Accounting, Odoo18 Financial Reports, Odoo18 Asset, Odoo18 Profit and Loss, PDC, Followups, Odoo18, Accounting, Odoo Apps, Reports""", 'summary': """Odoo 18 Accounting, Odoo 18 Accounting Reports, Odoo18 Accounting, Odoo Accounting, Odoo18 Financial Reports, Odoo18 Asset, Odoo18 Profit and Loss, PDC, Followups, Odoo18, Accounting, Odoo Apps, Reports""",

45
base_accounting_kit/controllers/statement_report.py

@ -27,28 +27,47 @@ from odoo.tools import html_escape
class XLSXReportController(http.Controller): class XLSXReportController(http.Controller):
""" Controller for xlsx report """ """ Controller for xlsx report """
@http.route('/xlsx_report', type='http', auth='user', methods=['POST'], @http.route('/xlsx_report', type='http', auth='user', methods=['POST'],
csrf=False) csrf=False)
def get_report_xlsx(self, model, options, output_format, report_name): def get_report_xlsx(self, model, data, output_format, report_name,
""" Get xlsx report data """ report_action):
report_obj = request.env[model].sudo() """Generate an XLSX report based on the provided data and return it as
print("oo") a response.
options = json.loads(options) 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: try:
if output_format == 'xlsx': if output_format == 'xlsx':
response = request.make_response( response = request.make_response(
None, headers=[ None,
headers=[
('Content-Type', 'application/vnd.ms-excel'), ('Content-Type', 'application/vnd.ms-excel'),
('Content-Disposition', content_disposition( ('Content-Disposition',
report_name + '.xlsx'))]) content_disposition(report_name + '.xlsx'))
report_obj.get_xlsx_report(options, response) ]
response.set_cookie('fileToken', 'dummy token') )
report_obj.get_xlsx_report(data, response, report_name,
report_action)
response.set_cookie('fileToken', token)
return response return response
except Exception as event: except Exception as e:
serialize = http.serialize_exception(event) se = http.serialize_exception(e)
error = { error = {
'code': 200, 'code': 200,
'message': 'Odoo Server Error', 'message': 'Odoo Server Error',
'data': serialize 'data': se
} }
return request.make_response(html_escape(json.dumps(error))) return request.make_response(html_escape(json.dumps(error)))

5
base_accounting_kit/doc/RELEASE_NOTES.md

@ -54,3 +54,8 @@
#### Version 18.0.5.0.7 #### Version 18.0.5.0.7
#### FIX #### FIX
- Fixed Transactions button redirection for bank and cash journals to display journal-specific transactions, and added reconciliation filter for the To Reconcile action. - Fixed Transactions button redirection for bank and cash journals to display journal-specific transactions, and added reconciliation filter for the To Reconcile action.
#### 03.12.2025
#### Version 18.0.5.0.8
#### FIX
- Fixed the issues in the controller while printing the xlsx report.

Loading…
Cancel
Save