diff --git a/one2many_excel_report/README.rst b/one2many_excel_report/README.rst new file mode 100644 index 000000000..d6843af69 --- /dev/null +++ b/one2many_excel_report/README.rst @@ -0,0 +1,49 @@ +.. 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 17:Farook Al Ameen @cybrosys + Version 18:Shikhil Raj @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..456e7927e --- /dev/null +++ b/one2many_excel_report/__init__.py @@ -0,0 +1,25 @@ + +"""One2many_excel""" +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-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..af363f8f0 --- /dev/null +++ b/one2many_excel_report/__manifest__.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-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': "18.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.jpg'], + '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..519afc654 --- /dev/null +++ b/one2many_excel_report/controllers/__init__.py @@ -0,0 +1,24 @@ +"""Controllers""" +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-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..15f2ce287 --- /dev/null +++ b/one2many_excel_report/controllers/excel.py @@ -0,0 +1,73 @@ +"""Excel report""" +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-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', '=', 'list')], + 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' + 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..451dda4d4 --- /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) 2025-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..59933e274 --- /dev/null +++ b/one2many_excel_report/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 22.04.2025 +#### Version 18.0.1.0.0 +##### ADD +- Initial commit for One2many Excel Report \ No newline at end of file diff --git a/one2many_excel_report/models/__init__.py b/one2many_excel_report/models/__init__.py new file mode 100644 index 000000000..4f5c9d7fc --- /dev/null +++ b/one2many_excel_report/models/__init__.py @@ -0,0 +1,23 @@ +"""One2many excel""" +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-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..10cb87be8 --- /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) 2025-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/cybro-icon.png b/one2many_excel_report/static/description/assets/cybro-icon.png new file mode 100644 index 000000000..06e73e11d Binary files /dev/null and b/one2many_excel_report/static/description/assets/cybro-icon.png differ diff --git a/one2many_excel_report/static/description/assets/cybro-odoo.png b/one2many_excel_report/static/description/assets/cybro-odoo.png new file mode 100644 index 000000000..ed02e07a4 Binary files /dev/null and b/one2many_excel_report/static/description/assets/cybro-odoo.png differ diff --git a/one2many_excel_report/static/description/assets/h2.png b/one2many_excel_report/static/description/assets/h2.png new file mode 100644 index 000000000..0bfc4707d Binary files /dev/null and b/one2many_excel_report/static/description/assets/h2.png differ diff --git a/one2many_excel_report/static/description/assets/icons/arrows-repeat.svg b/one2many_excel_report/static/description/assets/icons/arrows-repeat.svg new file mode 100644 index 000000000..1d7efabc5 --- /dev/null +++ b/one2many_excel_report/static/description/assets/icons/arrows-repeat.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/one2many_excel_report/static/description/assets/icons/banner-1.png b/one2many_excel_report/static/description/assets/icons/banner-1.png new file mode 100644 index 000000000..c180db172 Binary files /dev/null and b/one2many_excel_report/static/description/assets/icons/banner-1.png differ diff --git a/one2many_excel_report/static/description/assets/icons/banner-2.svg b/one2many_excel_report/static/description/assets/icons/banner-2.svg new file mode 100644 index 000000000..e606d97d9 --- /dev/null +++ b/one2many_excel_report/static/description/assets/icons/banner-2.svg @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/one2many_excel_report/static/description/assets/icons/banner-bg.png b/one2many_excel_report/static/description/assets/icons/banner-bg.png new file mode 100644 index 000000000..a8238d3c0 Binary files /dev/null and b/one2many_excel_report/static/description/assets/icons/banner-bg.png differ diff --git a/one2many_excel_report/static/description/assets/icons/banner-bg.svg b/one2many_excel_report/static/description/assets/icons/banner-bg.svg new file mode 100644 index 000000000..b1378103e --- /dev/null +++ b/one2many_excel_report/static/description/assets/icons/banner-bg.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/one2many_excel_report/static/description/assets/icons/banner-call.svg b/one2many_excel_report/static/description/assets/icons/banner-call.svg new file mode 100644 index 000000000..96c687e81 --- /dev/null +++ b/one2many_excel_report/static/description/assets/icons/banner-call.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/one2many_excel_report/static/description/assets/icons/banner-mail.svg b/one2many_excel_report/static/description/assets/icons/banner-mail.svg new file mode 100644 index 000000000..cbf0d158d --- /dev/null +++ b/one2many_excel_report/static/description/assets/icons/banner-mail.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/one2many_excel_report/static/description/assets/icons/banner-pattern.svg b/one2many_excel_report/static/description/assets/icons/banner-pattern.svg new file mode 100644 index 000000000..9c1c7e101 --- /dev/null +++ b/one2many_excel_report/static/description/assets/icons/banner-pattern.svg @@ -0,0 +1,343 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/one2many_excel_report/static/description/assets/icons/banner-promo.svg b/one2many_excel_report/static/description/assets/icons/banner-promo.svg new file mode 100644 index 000000000..d52791b11 --- /dev/null +++ b/one2many_excel_report/static/description/assets/icons/banner-promo.svg @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/one2many_excel_report/static/description/assets/icons/brand-pair.svg b/one2many_excel_report/static/description/assets/icons/brand-pair.svg new file mode 100644 index 000000000..d8db7fc1e --- /dev/null +++ b/one2many_excel_report/static/description/assets/icons/brand-pair.svg @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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/close-icon.svg b/one2many_excel_report/static/description/assets/icons/close-icon.svg new file mode 100644 index 000000000..df8cce37a --- /dev/null +++ b/one2many_excel_report/static/description/assets/icons/close-icon.svg @@ -0,0 +1,5 @@ + + + + + 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/collabarate-icon.svg b/one2many_excel_report/static/description/assets/icons/collabarate-icon.svg new file mode 100644 index 000000000..dd4e10518 --- /dev/null +++ b/one2many_excel_report/static/description/assets/icons/collabarate-icon.svg @@ -0,0 +1,3 @@ + + + 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/cybro-logo.png b/one2many_excel_report/static/description/assets/icons/cybro-logo.png new file mode 100644 index 000000000..ff4b78220 Binary files /dev/null and b/one2many_excel_report/static/description/assets/icons/cybro-logo.png differ diff --git a/one2many_excel_report/static/description/assets/icons/down.svg b/one2many_excel_report/static/description/assets/icons/down.svg new file mode 100644 index 000000000..f21c36271 --- /dev/null +++ b/one2many_excel_report/static/description/assets/icons/down.svg @@ -0,0 +1 @@ + \ No newline at end of file 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/faq.png b/one2many_excel_report/static/description/assets/icons/faq.png new file mode 100644 index 000000000..4250b5b81 Binary files /dev/null and b/one2many_excel_report/static/description/assets/icons/faq.png differ diff --git a/one2many_excel_report/static/description/assets/icons/feature-icon.svg b/one2many_excel_report/static/description/assets/icons/feature-icon.svg new file mode 100644 index 000000000..fa0ea6850 --- /dev/null +++ b/one2many_excel_report/static/description/assets/icons/feature-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/one2many_excel_report/static/description/assets/icons/feature.png b/one2many_excel_report/static/description/assets/icons/feature.png new file mode 100644 index 000000000..ac7a785c0 Binary files /dev/null and b/one2many_excel_report/static/description/assets/icons/feature.png differ diff --git a/one2many_excel_report/static/description/assets/icons/gear.svg b/one2many_excel_report/static/description/assets/icons/gear.svg new file mode 100644 index 000000000..0cc66b6ea --- /dev/null +++ b/one2many_excel_report/static/description/assets/icons/gear.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/one2many_excel_report/static/description/assets/icons/hero.gif b/one2many_excel_report/static/description/assets/icons/hero.gif new file mode 100644 index 000000000..380654dfe Binary files /dev/null and b/one2many_excel_report/static/description/assets/icons/hero.gif differ diff --git a/one2many_excel_report/static/description/assets/icons/hire-odoo.svg b/one2many_excel_report/static/description/assets/icons/hire-odoo.svg new file mode 100644 index 000000000..e1ac089b0 --- /dev/null +++ b/one2many_excel_report/static/description/assets/icons/hire-odoo.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + 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/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/life-ring-icon.svg b/one2many_excel_report/static/description/assets/icons/life-ring-icon.svg new file mode 100644 index 000000000..3ae6e1d89 --- /dev/null +++ b/one2many_excel_report/static/description/assets/icons/life-ring-icon.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + 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/mail.svg b/one2many_excel_report/static/description/assets/icons/mail.svg new file mode 100644 index 000000000..1eedde695 --- /dev/null +++ b/one2many_excel_report/static/description/assets/icons/mail.svg @@ -0,0 +1,3 @@ + + + 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/notes.png b/one2many_excel_report/static/description/assets/icons/notes.png new file mode 100644 index 000000000..ee5e95404 Binary files /dev/null and b/one2many_excel_report/static/description/assets/icons/notes.png differ diff --git a/one2many_excel_report/static/description/assets/icons/notification icon.svg b/one2many_excel_report/static/description/assets/icons/notification icon.svg new file mode 100644 index 000000000..053189973 --- /dev/null +++ b/one2many_excel_report/static/description/assets/icons/notification icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/one2many_excel_report/static/description/assets/icons/odoo-consultancy.svg b/one2many_excel_report/static/description/assets/icons/odoo-consultancy.svg new file mode 100644 index 000000000..e05f65bde --- /dev/null +++ b/one2many_excel_report/static/description/assets/icons/odoo-consultancy.svg @@ -0,0 +1,4 @@ + + + + diff --git a/one2many_excel_report/static/description/assets/icons/odoo-licencing.svg b/one2many_excel_report/static/description/assets/icons/odoo-licencing.svg new file mode 100644 index 000000000..2606c88b0 --- /dev/null +++ b/one2many_excel_report/static/description/assets/icons/odoo-licencing.svg @@ -0,0 +1,3 @@ + + + diff --git a/one2many_excel_report/static/description/assets/icons/odoo-logo.png b/one2many_excel_report/static/description/assets/icons/odoo-logo.png new file mode 100644 index 000000000..0e4d0eb5a Binary files /dev/null and b/one2many_excel_report/static/description/assets/icons/odoo-logo.png differ diff --git a/one2many_excel_report/static/description/assets/icons/patter.svg b/one2many_excel_report/static/description/assets/icons/patter.svg new file mode 100644 index 000000000..25c9c0a8f --- /dev/null +++ b/one2many_excel_report/static/description/assets/icons/patter.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/one2many_excel_report/static/description/assets/icons/pattern1.png b/one2many_excel_report/static/description/assets/icons/pattern1.png new file mode 100644 index 000000000..09ab0fb2d Binary files /dev/null and b/one2many_excel_report/static/description/assets/icons/pattern1.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-piece-icon.svg b/one2many_excel_report/static/description/assets/icons/puzzle-piece-icon.svg new file mode 100644 index 000000000..3e9ad9373 --- /dev/null +++ b/one2many_excel_report/static/description/assets/icons/puzzle-piece-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + 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/replace-icon.svg b/one2many_excel_report/static/description/assets/icons/replace-icon.svg new file mode 100644 index 000000000..d0e3a7af1 --- /dev/null +++ b/one2many_excel_report/static/description/assets/icons/replace-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + 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/screenshot-main.png b/one2many_excel_report/static/description/assets/icons/screenshot-main.png new file mode 100644 index 000000000..575f8e676 Binary files /dev/null and b/one2many_excel_report/static/description/assets/icons/screenshot-main.png differ diff --git a/one2many_excel_report/static/description/assets/icons/screenshot.png b/one2many_excel_report/static/description/assets/icons/screenshot.png new file mode 100644 index 000000000..cef272529 Binary files /dev/null and b/one2many_excel_report/static/description/assets/icons/screenshot.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/skype-fill.svg b/one2many_excel_report/static/description/assets/icons/skype-fill.svg new file mode 100644 index 000000000..c17423639 --- /dev/null +++ b/one2many_excel_report/static/description/assets/icons/skype-fill.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/one2many_excel_report/static/description/assets/icons/skype.png b/one2many_excel_report/static/description/assets/icons/skype.png new file mode 100644 index 000000000..51b409fb3 Binary files /dev/null and b/one2many_excel_report/static/description/assets/icons/skype.png differ diff --git a/one2many_excel_report/static/description/assets/icons/skype.svg b/one2many_excel_report/static/description/assets/icons/skype.svg new file mode 100644 index 000000000..df3dad39b --- /dev/null +++ b/one2many_excel_report/static/description/assets/icons/skype.svg @@ -0,0 +1,3 @@ + + + diff --git a/one2many_excel_report/static/description/assets/icons/star-1.svg b/one2many_excel_report/static/description/assets/icons/star-1.svg new file mode 100644 index 000000000..7e55ab162 --- /dev/null +++ b/one2many_excel_report/static/description/assets/icons/star-1.svg @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/one2many_excel_report/static/description/assets/icons/star-2.svg b/one2many_excel_report/static/description/assets/icons/star-2.svg new file mode 100644 index 000000000..5ae9f507a --- /dev/null +++ b/one2many_excel_report/static/description/assets/icons/star-2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/one2many_excel_report/static/description/assets/icons/support.png b/one2many_excel_report/static/description/assets/icons/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/one2many_excel_report/static/description/assets/icons/support.png differ diff --git a/one2many_excel_report/static/description/assets/icons/test-1 - Copy.png b/one2many_excel_report/static/description/assets/icons/test-1 - Copy.png new file mode 100644 index 000000000..f6a902663 Binary files /dev/null and b/one2many_excel_report/static/description/assets/icons/test-1 - Copy.png differ diff --git a/one2many_excel_report/static/description/assets/icons/test-1.png b/one2many_excel_report/static/description/assets/icons/test-1.png new file mode 100644 index 000000000..0908add2b Binary files /dev/null and b/one2many_excel_report/static/description/assets/icons/test-1.png differ diff --git a/one2many_excel_report/static/description/assets/icons/test-2.png b/one2many_excel_report/static/description/assets/icons/test-2.png new file mode 100644 index 000000000..4671fe91e Binary files /dev/null and b/one2many_excel_report/static/description/assets/icons/test-2.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/translate.svg b/one2many_excel_report/static/description/assets/icons/translate.svg new file mode 100644 index 000000000..af9c8a1aa --- /dev/null +++ b/one2many_excel_report/static/description/assets/icons/translate.svg @@ -0,0 +1,10 @@ + + + + + + + + + + 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/video.png b/one2many_excel_report/static/description/assets/icons/video.png new file mode 100644 index 000000000..576705b17 Binary files /dev/null and b/one2many_excel_report/static/description/assets/icons/video.png differ diff --git a/one2many_excel_report/static/description/assets/icons/whatsapp.png b/one2many_excel_report/static/description/assets/icons/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/one2many_excel_report/static/description/assets/icons/whatsapp.png differ diff --git a/one2many_excel_report/static/description/assets/icons/wrench-icon.svg b/one2many_excel_report/static/description/assets/icons/wrench-icon.svg new file mode 100644 index 000000000..174b5a465 --- /dev/null +++ b/one2many_excel_report/static/description/assets/icons/wrench-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + 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/modules/1.jpg b/one2many_excel_report/static/description/assets/modules/1.jpg new file mode 100644 index 000000000..0178d2964 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.jpg b/one2many_excel_report/static/description/assets/modules/2.jpg new file mode 100644 index 000000000..580ea075d Binary files /dev/null and b/one2many_excel_report/static/description/assets/modules/2.jpg differ diff --git a/one2many_excel_report/static/description/assets/modules/3.png b/one2many_excel_report/static/description/assets/modules/3.png new file mode 100644 index 000000000..662660527 Binary files /dev/null and b/one2many_excel_report/static/description/assets/modules/3.png 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..cd5fffdd6 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..73613d2fb 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..5a36b384e 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..787683a1e 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..b529fb4ed 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..24e7e921a 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/hero.gif b/one2many_excel_report/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..a7e808295 Binary files /dev/null and b/one2many_excel_report/static/description/assets/screenshots/hero.gif differ diff --git a/one2many_excel_report/static/description/assets/y18.jpg b/one2many_excel_report/static/description/assets/y18.jpg new file mode 100644 index 000000000..eea1714f2 Binary files /dev/null and b/one2many_excel_report/static/description/assets/y18.jpg differ diff --git a/one2many_excel_report/static/description/banner.jpg b/one2many_excel_report/static/description/banner.jpg new file mode 100644 index 000000000..81ee7aaec Binary files /dev/null and b/one2many_excel_report/static/description/banner.jpg 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..d0c6c5e5d 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..e8690ef75 --- /dev/null +++ b/one2many_excel_report/static/description/index.html @@ -0,0 +1,882 @@ + + + + + + One2many Excel Report + + + + + + + + + + +
+
+ + + +
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+ +
+
+
+
+

+ Generate XLSX Reports for One2many Fields +

+

One2many Excel Report +

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

Key + Highlights

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

+

+
+
+
+
+ +
+
+
+ One2many Excel Report +

+ Are you ready to make your business more + organized? +
Improve now! +

+ +
+
+ +
+
+
+ + + +
+
+ +
+
+
+
+ acc_bg +
+ +
+
+
+
+

+ 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. +

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

+ Available in + Odoo 18.0 Community and + Enterprise. +

+
+
+

+

+
+
+
+
+
+
+
+ +
+

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

+
+
+

+

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

+ Yes, add the widget "one2many_excel" + for the one2many field. After that, you will get a + download button in the one2many field view and + you can download the one2many field data as an Excel report. +

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

+ Latest Release 18.0.1.0.0 +

+ + 22th April, 2025 + +
+
+
+
+
+ Add +
+
+
+
    +
  • + Initial Commit +
  • +
+
+
+
+
+
+
+
+
+
+ + + + + +
+

+ Our Services

+ +
+ +
+
+ .... +
+
+ +
+ + +
+
+ + + + + + 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..ebd9ddeec --- /dev/null +++ b/one2many_excel_report/static/src/js/X2ManyField.js @@ -0,0 +1,44 @@ +/** @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..0d5c4964f --- /dev/null +++ b/one2many_excel_report/static/src/js/action_manager.js @@ -0,0 +1,18 @@ +/** @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..aafff05a0 --- /dev/null +++ b/one2many_excel_report/static/src/xml/X2ManyField.xml @@ -0,0 +1,19 @@ + + + + + +
+ + + + +
+
+
+
+ + +