diff --git a/one2many_excel_report/README.rst b/one2many_excel_report/README.rst new file mode 100644 index 000000000..d2d58630f --- /dev/null +++ b/one2many_excel_report/README.rst @@ -0,0 +1,50 @@ +.. image:: https://img.shields.io/badge/licence-LGPL--3-blue.svg + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 + +One2many Excel Report +================================= +This module is used to print the excel report of the one2many fields using the +'one2many_excel' widget + +Configuration +============= +* Add the widget "one2many_excel" for one2many field. + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +General Public License, Version 3 (LGPL v3). +(https://www.odoo.com/documentation/user/16.0/legal/licenses/licenses.html) + + +Credits +------- +* Developers: Cybrosys Techno Solutions odoo@cybrosys.com + Version 16: Gayathri V @cybrosys + Version 17:Farook Al Ameen @cybrosys + +Contacts +-------- +* Mail Contact : odoo@cybrosys.com +* Website : https://cybrosys.com + +Bug Tracker +----------- +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Maintainer +========== +.. image:: https://cybrosys.com/images/logo.png + :target: https://cybrosys.com + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit `Our Website `__ + +Further information +=================== +HTML Description: ``__ \ No newline at end of file diff --git a/one2many_excel_report/__init__.py b/one2many_excel_report/__init__.py new file mode 100644 index 000000000..9c59d4c87 --- /dev/null +++ b/one2many_excel_report/__init__.py @@ -0,0 +1,24 @@ +"""One2many_excel""" +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# 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 . +# +############################################################################# +from . import controllers +from . import models diff --git a/one2many_excel_report/__manifest__.py b/one2many_excel_report/__manifest__.py new file mode 100644 index 000000000..35f4d4d38 --- /dev/null +++ b/one2many_excel_report/__manifest__.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# 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 . +# +############################################################################# +{ + 'name': 'One2many Excel Report', + 'version': "17.0.1.0.0", + 'summary': """One2many Excel Report which is used to print the excel report + of one2many fields.""", + 'description': """One2many Excel Report is a module which uses a widget + called one2many_excel for printing reports for one2many fields.""", + 'category': 'Extra Tools', + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'depends': ['web', 'base'], + 'data': [ + 'security/ir.model.access.csv', ], + 'assets': { + 'web.assets_backend': [ + 'one2many_excel_report/static/src/xml/X2ManyField.xml', + 'one2many_excel_report/static/src/js/X2ManyField.js', + 'one2many_excel_report/static/src/js/action_manager.js', + ], + }, + 'images': ['static/description/banner.png'], + 'license': 'LGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/one2many_excel_report/controllers/__init__.py b/one2many_excel_report/controllers/__init__.py new file mode 100644 index 000000000..d5b084b70 --- /dev/null +++ b/one2many_excel_report/controllers/__init__.py @@ -0,0 +1,24 @@ +"""Controllers""" +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# 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 . +# +############################################################################# +from . import excel +from . import one2many_excel_report diff --git a/one2many_excel_report/controllers/excel.py b/one2many_excel_report/controllers/excel.py new file mode 100644 index 000000000..61c32e8a2 --- /dev/null +++ b/one2many_excel_report/controllers/excel.py @@ -0,0 +1,75 @@ +"""Excel report""" +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# 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 . +# +############################################################################# +import json +import xml.etree.ElementTree as ET +from odoo import http +from odoo.http import content_disposition, request +from odoo.tools import html_escape + + +class XLSXReportController(http.Controller): + """Excel report for one2many fields""" + + @http.route('/xlsx_reports', type='http', auth='user', methods=['POST'], + csrf=False) + def get_report_xlsx(self, + report_name='excel', **kwargs): + """Used to get the report data that are fetched from the one2many""" + model = kwargs.get('current_model') + model_id = kwargs.get('id') + field = kwargs.get('field') + views = request.env['ir.ui.view'].search([('model', '=', model), + ('type', '=', 'tree')], + order='id asc', limit=1) + tree = ET.fromstring(views.arch) + names = [field.get('name') for field in tree.findall('field')] + report_data = request.env[model].sudo().search_read( + domain=[(field, '=', int(model_id))], + fields=names) + uid = request.session.uid + report_obj = request.env['one2many.report.excel'].with_user(uid) + output_format = 'xlsx' + token = 'dummy-because-api-expects-one' + # print(report_data[1]['order_id']) + # print(report_data['order_id']) + 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(report_data, names, response) + 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))) diff --git a/one2many_excel_report/controllers/one2many_excel_report.py b/one2many_excel_report/controllers/one2many_excel_report.py new file mode 100644 index 000000000..9af438436 --- /dev/null +++ b/one2many_excel_report/controllers/one2many_excel_report.py @@ -0,0 +1,70 @@ +"""Excel report""" +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# 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 . +# +############################################################################# +import io +from odoo import fields, http +from odoo.http import content_disposition, request + +try: + from odoo.tools.misc import xlsxwriter +except ImportError: + import xlsxwriter + + +class ExcelHttp(http.Controller): + """Used to print the excel report""" + @http.route('/get/excel', type='json', auth='user', methods=['POST'], + csrf=False) + def get_excel_report(self): + """"Formats the excel report""" + response = request.make_response( + None, + headers=[ + ('Content-Type', 'application/vnd.ms-excel'), + ('Content-Disposition', content_disposition('Report' + '.xlsx')) + ] + ) + output = io.BytesIO() + workbook = xlsxwriter.Workbook(output, {'in_memory': True}) + workbook.add_worksheet("Excel Report") + output = io.BytesIO() + workbook = xlsxwriter.Workbook(output, {'in_memory': True}) + sheet = workbook.add_worksheet() + # Formats + format1 = workbook.add_format( + {'font_size': 15, 'align': 'center', 'bold': True}) + format1.set_font_color('#000080') + format2 = workbook.add_format( + {'font_size': 11, 'bold': True, 'border': 1, 'bg_color': '#928E8E'}) + format4 = workbook.add_format( + {'font_size': 10, 'num_format': 'yyyy-m-d', 'bold': True}) + format2.set_align('center') + format4.set_align('right') + sheet.merge_range(1, 1, 1, 1, + 'A', format1) + sheet.write(2, 0, "Date :", format4) + sheet.write(2, 1, fields.Datetime.today(), format4) + workbook.close() + output.seek(0) + response.stream.write(output.read()) + output.close() + return response diff --git a/one2many_excel_report/doc/RELEASE_NOTES.md b/one2many_excel_report/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..7e4153050 --- /dev/null +++ b/one2many_excel_report/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 05.07.2023 +#### Version 17.0.1.0.0 +##### ADD +- Initial commit for One2many Excel Report diff --git a/one2many_excel_report/models/__init__.py b/one2many_excel_report/models/__init__.py new file mode 100644 index 000000000..a46beb4cf --- /dev/null +++ b/one2many_excel_report/models/__init__.py @@ -0,0 +1,23 @@ +"""One2many excel""" +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# 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 . +# +############################################################################# +from . import report_excel diff --git a/one2many_excel_report/models/report_excel.py b/one2many_excel_report/models/report_excel.py new file mode 100644 index 000000000..5e756c60b --- /dev/null +++ b/one2many_excel_report/models/report_excel.py @@ -0,0 +1,99 @@ +"""One2many excel report""" +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# 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 . +# +############################################################################# +import io +from odoo import models, fields + +try: + from odoo.tools.misc import xlsxwriter +except ImportError: + import xlsxwriter + + +class One2manyExcelReport(models.Model): + """Used to get the excel report function""" + _name = 'one2many.report.excel' + _description = 'One2many Excel Report' + + def clean_data(self, value): + if isinstance(value, str): + # Remove leading digits and dot + return ' '.join(value.split()[1:]) if value.split()[0].replace('.', '').isdigit() else value + return value + + def get_xlsx_report(self, data, names, response): + """Used to print the excel report""" + sl = 0 + row_num = 7 + output = io.BytesIO() + workbook = xlsxwriter.Workbook(output, {'in_memory': True}) + sheet = workbook.add_worksheet() + cell_format = workbook.add_format( + {'font_size': '12px', 'align': 'center'}) + date_style = workbook.add_format( + {'text_wrap': True, 'bold': True, 'num_format': 'dd-mm-yyyy'}) + head = workbook.add_format( + {'align': 'center', 'bold': True, 'font_size': '20px'}) + txt = workbook.add_format({'font_size': '10px', 'align': 'center'}) + + # Set column widths + for col in range(20): # Adjust the range based on your needs + sheet.set_column(col, col, 15) # Set each column to width 15 + + sheet.merge_range('B2:I3', 'EXCEL REPORT', head) + sheet.merge_range('A6:B6', 'Date:', date_style) + sheet.merge_range('C6:D6', fields.Datetime.today(), date_style) + + for doc in names: + sl += 1 + row_num += 1 + col_num = 0 + sheet.merge_range(row_num, col_num + 2, row_num, + col_num + 4, doc, cell_format) + col_num += 1 + + data_list = [] + for rec in data: + for x in rec: + if isinstance(rec[x], tuple): + st = ' '.join(map(str, rec[x])) + data_list.append({'data': self.clean_data(st)}) + else: + data_list.append({'data': self.clean_data(rec[x])}) + + sl = 3 + row_num = 7 + col_num = 4 + num = row_num + len(names) + 1 + for doc in data_list: + sl += 1 + sheet.merge_range(row_num, col_num + 2, row_num, + col_num + 4, doc['data'], txt) + row_num += 1 + if row_num == num: + col_num += 3 + row_num = 7 + + workbook.close() + output.seek(0) + response.stream.write(output.read()) + output.close() \ No newline at end of file diff --git a/one2many_excel_report/security/ir.model.access.csv b/one2many_excel_report/security/ir.model.access.csv new file mode 100644 index 000000000..f249f18c0 --- /dev/null +++ b/one2many_excel_report/security/ir.model.access.csv @@ -0,0 +1,2 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_one2many_report_excel,access.one2many.report.excel,model_one2many_report_excel,base.group_user,1,1,1,1 \ No newline at end of file diff --git a/one2many_excel_report/static/description/assets/icons/capture (1).png b/one2many_excel_report/static/description/assets/icons/capture (1).png new file mode 100644 index 000000000..8824deafc Binary files /dev/null and b/one2many_excel_report/static/description/assets/icons/capture (1).png differ diff --git a/one2many_excel_report/static/description/assets/icons/check.png b/one2many_excel_report/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/one2many_excel_report/static/description/assets/icons/check.png differ diff --git a/one2many_excel_report/static/description/assets/icons/chevron.png b/one2many_excel_report/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/one2many_excel_report/static/description/assets/icons/chevron.png differ diff --git a/one2many_excel_report/static/description/assets/icons/cogs.png b/one2many_excel_report/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/one2many_excel_report/static/description/assets/icons/cogs.png differ diff --git a/one2many_excel_report/static/description/assets/icons/consultation.png b/one2many_excel_report/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/one2many_excel_report/static/description/assets/icons/consultation.png differ diff --git a/one2many_excel_report/static/description/assets/icons/ecom-black.png b/one2many_excel_report/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/one2many_excel_report/static/description/assets/icons/ecom-black.png differ diff --git a/one2many_excel_report/static/description/assets/icons/education-black.png b/one2many_excel_report/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/one2many_excel_report/static/description/assets/icons/education-black.png differ diff --git a/one2many_excel_report/static/description/assets/icons/hotel-black.png b/one2many_excel_report/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/one2many_excel_report/static/description/assets/icons/hotel-black.png differ diff --git a/one2many_excel_report/static/description/assets/icons/img.png b/one2many_excel_report/static/description/assets/icons/img.png new file mode 100644 index 000000000..70197f477 Binary files /dev/null and b/one2many_excel_report/static/description/assets/icons/img.png differ diff --git a/one2many_excel_report/static/description/assets/icons/license.png b/one2many_excel_report/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/one2many_excel_report/static/description/assets/icons/license.png differ diff --git a/one2many_excel_report/static/description/assets/icons/lifebuoy.png b/one2many_excel_report/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/one2many_excel_report/static/description/assets/icons/lifebuoy.png differ diff --git a/one2many_excel_report/static/description/assets/icons/manufacturing-black.png b/one2many_excel_report/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/one2many_excel_report/static/description/assets/icons/manufacturing-black.png differ diff --git a/one2many_excel_report/static/description/assets/icons/photo-capture.png b/one2many_excel_report/static/description/assets/icons/photo-capture.png new file mode 100644 index 000000000..06c111758 Binary files /dev/null and b/one2many_excel_report/static/description/assets/icons/photo-capture.png differ diff --git a/one2many_excel_report/static/description/assets/icons/pos-black.png b/one2many_excel_report/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/one2many_excel_report/static/description/assets/icons/pos-black.png differ diff --git a/one2many_excel_report/static/description/assets/icons/puzzle.png b/one2many_excel_report/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/one2many_excel_report/static/description/assets/icons/puzzle.png differ diff --git a/one2many_excel_report/static/description/assets/icons/restaurant-black.png b/one2many_excel_report/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/one2many_excel_report/static/description/assets/icons/restaurant-black.png differ diff --git a/one2many_excel_report/static/description/assets/icons/service-black.png b/one2many_excel_report/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/one2many_excel_report/static/description/assets/icons/service-black.png differ diff --git a/one2many_excel_report/static/description/assets/icons/trading-black.png b/one2many_excel_report/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/one2many_excel_report/static/description/assets/icons/trading-black.png differ diff --git a/one2many_excel_report/static/description/assets/icons/training.png b/one2many_excel_report/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/one2many_excel_report/static/description/assets/icons/training.png differ diff --git a/one2many_excel_report/static/description/assets/icons/update.png b/one2many_excel_report/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/one2many_excel_report/static/description/assets/icons/update.png differ diff --git a/one2many_excel_report/static/description/assets/icons/user.png b/one2many_excel_report/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/one2many_excel_report/static/description/assets/icons/user.png differ diff --git a/one2many_excel_report/static/description/assets/icons/wrench.png b/one2many_excel_report/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/one2many_excel_report/static/description/assets/icons/wrench.png differ diff --git a/one2many_excel_report/static/description/assets/misc/Cybrosys R.png b/one2many_excel_report/static/description/assets/misc/Cybrosys R.png new file mode 100644 index 000000000..da4058087 Binary files /dev/null and b/one2many_excel_report/static/description/assets/misc/Cybrosys R.png differ diff --git a/one2many_excel_report/static/description/assets/misc/categories.png b/one2many_excel_report/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/one2many_excel_report/static/description/assets/misc/categories.png differ diff --git a/one2many_excel_report/static/description/assets/misc/check-box.png b/one2many_excel_report/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/one2many_excel_report/static/description/assets/misc/check-box.png differ diff --git a/one2many_excel_report/static/description/assets/misc/compass.png b/one2many_excel_report/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/one2many_excel_report/static/description/assets/misc/compass.png differ diff --git a/one2many_excel_report/static/description/assets/misc/corporate.png b/one2many_excel_report/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/one2many_excel_report/static/description/assets/misc/corporate.png differ diff --git a/one2many_excel_report/static/description/assets/misc/customer-support.png b/one2many_excel_report/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/one2many_excel_report/static/description/assets/misc/customer-support.png differ diff --git a/one2many_excel_report/static/description/assets/misc/cybrosys-logo.png b/one2many_excel_report/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/one2many_excel_report/static/description/assets/misc/cybrosys-logo.png differ diff --git a/one2many_excel_report/static/description/assets/misc/email.svg b/one2many_excel_report/static/description/assets/misc/email.svg new file mode 100644 index 000000000..15291cdc3 --- /dev/null +++ b/one2many_excel_report/static/description/assets/misc/email.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/one2many_excel_report/static/description/assets/misc/features.png b/one2many_excel_report/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/one2many_excel_report/static/description/assets/misc/features.png differ diff --git a/one2many_excel_report/static/description/assets/misc/logo.png b/one2many_excel_report/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/one2many_excel_report/static/description/assets/misc/logo.png differ diff --git a/one2many_excel_report/static/description/assets/misc/phone.svg b/one2many_excel_report/static/description/assets/misc/phone.svg new file mode 100644 index 000000000..b7bd7f251 --- /dev/null +++ b/one2many_excel_report/static/description/assets/misc/phone.svg @@ -0,0 +1,3 @@ + + + diff --git a/one2many_excel_report/static/description/assets/misc/pictures.png b/one2many_excel_report/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/one2many_excel_report/static/description/assets/misc/pictures.png differ diff --git a/one2many_excel_report/static/description/assets/misc/pie-chart.png b/one2many_excel_report/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/one2many_excel_report/static/description/assets/misc/pie-chart.png differ diff --git a/one2many_excel_report/static/description/assets/misc/right-arrow.png b/one2many_excel_report/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/one2many_excel_report/static/description/assets/misc/right-arrow.png differ diff --git a/one2many_excel_report/static/description/assets/misc/star (1) 2.svg b/one2many_excel_report/static/description/assets/misc/star (1) 2.svg new file mode 100644 index 000000000..5ae9f507a --- /dev/null +++ b/one2many_excel_report/static/description/assets/misc/star (1) 2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/one2many_excel_report/static/description/assets/misc/star.png b/one2many_excel_report/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/one2many_excel_report/static/description/assets/misc/star.png differ diff --git a/one2many_excel_report/static/description/assets/misc/support (1) 1.svg b/one2many_excel_report/static/description/assets/misc/support (1) 1.svg new file mode 100644 index 000000000..7d37a8f30 --- /dev/null +++ b/one2many_excel_report/static/description/assets/misc/support (1) 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/one2many_excel_report/static/description/assets/misc/support-email.svg b/one2many_excel_report/static/description/assets/misc/support-email.svg new file mode 100644 index 000000000..eb70370d6 --- /dev/null +++ b/one2many_excel_report/static/description/assets/misc/support-email.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/one2many_excel_report/static/description/assets/misc/support.png b/one2many_excel_report/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/one2many_excel_report/static/description/assets/misc/support.png differ diff --git a/one2many_excel_report/static/description/assets/misc/tick-mark.svg b/one2many_excel_report/static/description/assets/misc/tick-mark.svg new file mode 100644 index 000000000..2dbb40187 --- /dev/null +++ b/one2many_excel_report/static/description/assets/misc/tick-mark.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/one2many_excel_report/static/description/assets/misc/whatsapp 1.svg b/one2many_excel_report/static/description/assets/misc/whatsapp 1.svg new file mode 100644 index 000000000..0bfaf8fc6 --- /dev/null +++ b/one2many_excel_report/static/description/assets/misc/whatsapp 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/one2many_excel_report/static/description/assets/misc/whatsapp.png b/one2many_excel_report/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/one2many_excel_report/static/description/assets/misc/whatsapp.png differ diff --git a/one2many_excel_report/static/description/assets/misc/whatsapp.svg b/one2many_excel_report/static/description/assets/misc/whatsapp.svg new file mode 100644 index 000000000..b618aea1d --- /dev/null +++ b/one2many_excel_report/static/description/assets/misc/whatsapp.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/one2many_excel_report/static/description/assets/modules/1.jpg b/one2many_excel_report/static/description/assets/modules/1.jpg new file mode 100644 index 000000000..8513873ea Binary files /dev/null and b/one2many_excel_report/static/description/assets/modules/1.jpg differ diff --git a/one2many_excel_report/static/description/assets/modules/2.png b/one2many_excel_report/static/description/assets/modules/2.png new file mode 100644 index 000000000..6dffe78cc Binary files /dev/null and b/one2many_excel_report/static/description/assets/modules/2.png differ diff --git a/one2many_excel_report/static/description/assets/modules/3.jpg b/one2many_excel_report/static/description/assets/modules/3.jpg new file mode 100644 index 000000000..998fe2c96 Binary files /dev/null and b/one2many_excel_report/static/description/assets/modules/3.jpg differ diff --git a/one2many_excel_report/static/description/assets/modules/4.jpg b/one2many_excel_report/static/description/assets/modules/4.jpg new file mode 100644 index 000000000..237d5d976 Binary files /dev/null and b/one2many_excel_report/static/description/assets/modules/4.jpg differ diff --git a/one2many_excel_report/static/description/assets/modules/5.jpg b/one2many_excel_report/static/description/assets/modules/5.jpg new file mode 100644 index 000000000..e1aa53f5c Binary files /dev/null and b/one2many_excel_report/static/description/assets/modules/5.jpg differ diff --git a/one2many_excel_report/static/description/assets/modules/6.png b/one2many_excel_report/static/description/assets/modules/6.png new file mode 100644 index 000000000..bb668e760 Binary files /dev/null and b/one2many_excel_report/static/description/assets/modules/6.png differ diff --git a/one2many_excel_report/static/description/assets/screenshots/1.png b/one2many_excel_report/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..f500a6eab Binary files /dev/null and b/one2many_excel_report/static/description/assets/screenshots/1.png differ diff --git a/one2many_excel_report/static/description/assets/screenshots/2.png b/one2many_excel_report/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..c28a8bcc1 Binary files /dev/null and b/one2many_excel_report/static/description/assets/screenshots/2.png differ diff --git a/one2many_excel_report/static/description/assets/screenshots/3.png b/one2many_excel_report/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..b710020b2 Binary files /dev/null and b/one2many_excel_report/static/description/assets/screenshots/3.png differ diff --git a/one2many_excel_report/static/description/assets/screenshots/4.png b/one2many_excel_report/static/description/assets/screenshots/4.png new file mode 100644 index 000000000..fea07238d Binary files /dev/null and b/one2many_excel_report/static/description/assets/screenshots/4.png differ diff --git a/one2many_excel_report/static/description/assets/screenshots/5.png b/one2many_excel_report/static/description/assets/screenshots/5.png new file mode 100644 index 000000000..82ac4b7c5 Binary files /dev/null and b/one2many_excel_report/static/description/assets/screenshots/5.png differ diff --git a/one2many_excel_report/static/description/assets/screenshots/hero-v17.gif b/one2many_excel_report/static/description/assets/screenshots/hero-v17.gif new file mode 100644 index 000000000..ab9ae1a33 Binary files /dev/null and b/one2many_excel_report/static/description/assets/screenshots/hero-v17.gif differ diff --git a/one2many_excel_report/static/description/banner.png b/one2many_excel_report/static/description/banner.png new file mode 100644 index 000000000..cb9ef4096 Binary files /dev/null and b/one2many_excel_report/static/description/banner.png differ diff --git a/one2many_excel_report/static/description/icon.png b/one2many_excel_report/static/description/icon.png new file mode 100644 index 000000000..4308a48b3 Binary files /dev/null and b/one2many_excel_report/static/description/icon.png differ diff --git a/one2many_excel_report/static/description/index.html b/one2many_excel_report/static/description/index.html new file mode 100644 index 000000000..c6679aa22 --- /dev/null +++ b/one2many_excel_report/static/description/index.html @@ -0,0 +1,557 @@ + + + + + + + Odoo App 3 Index + + + + + + + + +
+
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+
+
+
+

+ One2many Excel Report

+

+ Generate XLSX Reports for One2many Fields +

+
+ +
+
+
+
+
+

+ Key Highlights +

+
+
+
+
+
+ +
+
+

+ Allows to print the excel report of the One2many fields.

+
+
+
+
+
+
+ +
+
+
+
+
+

+ Configuration

+ Add the widget "one2many_excel" for one2many field. +
+
+ +
+
+
+
+
+

+ One2Many Fields

+ After adding the widget in the one2many field we can see a button in the field. +
+
+
+ +
+
+
+
+
+

+ One2Many Excel Report

+ + By clicking the button we can print the report of that one2many field. +
+
+
+ +
+
+
+
+
+
+
    +
  • + Excel report for one2many fields +
  • +
+
+
+
+
+
+
Version + 17.0.1.0.0|Released on:01th October 2024 +
+

+
+
+
+
+
+
+
+

Related Products

+
+
+ +
+
+

Our Services

+ +
+
+
+
+
+
+
+
+ service-icon +
+
+

Odoo Customization

+
+
+
+
+
+
+ service-icon +
+
+

Odoo Implementation

+
+
+
+
+
+
+ service-icon +
+
+

Odoo Support

+
+
+
+
+
+
+ service-icon +
+
+

Hire Odoo Developer

+
+
+
+
+ +
+
+ service-icon +
+
+

Odoo Integration

+
+
+
+
+
+
+ service-icon +
+
+

Odoo Migration

+
+
+
+
+
+
+ service-icon +
+
+

Odoo Consultancy

+
+
+
+
+
+
+ service-icon +
+
+

Odoo Implementation

+
+
+
+
+
+
+ service-icon +
+
+

Odoo Licensing Consultancy

+
+
+
+
+
+
+

Our Industries

+ +
+
+
+
+
+
+ +

Trading

+

Easily procure and sell your products

+
+
+
+
+ +

POS

+

Easy configuration and convivial experience

+
+
+
+
+ +

Education

+

A platform for educational management

+
+
+
+
+ +

Manufacturing

+

Plan, track and schedule your operations

+
+
+
+
+ +

E-commerce & Website

+

Mobile friendly, awe-inspiring product pages

+
+
+
+
+ +

Service Management

+

Keep track of services and invoice

+
+
+
+
+ +

Restaurant

+

Run your bar or restaurant methodically

+
+
+
+
+ +

Hotel Management

+

An all-inclusive hotel management application

+
+
+
+
+
+
+

Support

+
+
+
+
+
+
+
+ +
+ Need + Help? +

Got questions or need help? Get in touch.

+
odoo@cybrosys.com +
+
+
+
+
+
+
+
+ +
+ WhatsApp +

Say hi to us on WhatsApp!

+
+91 + 99456767686
+
+
+
+
+
+
+
+
+ + + + + + diff --git a/one2many_excel_report/static/src/js/X2ManyField.js b/one2many_excel_report/static/src/js/X2ManyField.js new file mode 100644 index 000000000..362edf9f1 --- /dev/null +++ b/one2many_excel_report/static/src/js/X2ManyField.js @@ -0,0 +1,45 @@ +/** @odoo-module **/ +import { X2ManyField, x2ManyField } from "@web/views/fields/x2many/x2many_field"; +import { registry } from "@web/core/registry"; +import { ListRenderer } from "@web/views/list/list_renderer"; +import { useService } from "@web/core/utils/hooks"; + +export class ExcelListRenderer extends ListRenderer { + setup() { + super.setup(); + } +} +//Extends X2ManyField to create widget +export class ExcelX2ManyField extends X2ManyField { + setup() { + super.setup() + this.actionService = useService("action"); + + } + async Print_excel_report(){ + var model = this.props.record.resModel + var order = this.props.record.resId + var one2many = this.props.name + var relation=this.field.relation + var related_field = this.field.relation_field + var action = { + type: "ir.actions.report", + report_type: "xlsx", + report_name: 'Excel', + report_file: "report.excel", + context:{'model':relation,'id':order,'field':related_field}, + }; + return this.actionService.doAction(action); + } +} +ExcelX2ManyField.components = { + ...X2ManyField.components, ListRenderer: ExcelListRenderer +}; +ExcelX2ManyField.template = "one2many_excel_report.One2manyExcel"; + +export const excelX2ManyField = { + ...x2ManyField, + component: ExcelX2ManyField, +}; + +registry.category("fields").add("one2many_excel", excelX2ManyField); diff --git a/one2many_excel_report/static/src/js/action_manager.js b/one2many_excel_report/static/src/js/action_manager.js new file mode 100644 index 000000000..7c4349587 --- /dev/null +++ b/one2many_excel_report/static/src/js/action_manager.js @@ -0,0 +1,19 @@ +/** @odoo-module */ +import { registry } from "@web/core/registry"; +import { BlockUI } from "@web/core/ui/block_ui"; +import { download } from "@web/core/network/download"; +/** +This handler is responsible for generating XLSX reports. +*/ +registry.category("ir.actions.report handlers").add("xlsx", async function (action) { + if (action.report_type === 'xlsx') { + BlockUI; + + await download({ + url: '/xlsx_reports', + data: {'id':action.context.id,'field':action.context.field,'current_model':action.context.model}, + complete: () => unblockUI, + error: (error) => self.call('crash_manager', 'rpc_error', error), + }); + } +}); diff --git a/one2many_excel_report/static/src/xml/X2ManyField.xml b/one2many_excel_report/static/src/xml/X2ManyField.xml new file mode 100644 index 000000000..2752d667c --- /dev/null +++ b/one2many_excel_report/static/src/xml/X2ManyField.xml @@ -0,0 +1,18 @@ + + + + +
+ + + + +
+
+
+
+ + +