diff --git a/one2many_excel_report/README.rst b/one2many_excel_report/README.rst new file mode 100644 index 000000000..f8c4aeb8e --- /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 one2many_excel to the one2many fields as widget + +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 + +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..ee6dc7e44 --- /dev/null +++ b/one2many_excel_report/__init__.py @@ -0,0 +1,24 @@ +"""One2many_excel""" +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-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..bd3824e67 --- /dev/null +++ b/one2many_excel_report/__manifest__.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-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': "16.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..5a87cdd8f --- /dev/null +++ b/one2many_excel_report/controllers/__init__.py @@ -0,0 +1,24 @@ +"""Controllers""" +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-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..83016dc79 --- /dev/null +++ b/one2many_excel_report/controllers/excel.py @@ -0,0 +1,73 @@ +"""Excel report""" +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-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['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..90195080d --- /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) 2023-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..2381cd3cd --- /dev/null +++ b/one2many_excel_report/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 01.06.2023 +#### Version 16.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..bc2569f94 --- /dev/null +++ b/one2many_excel_report/models/__init__.py @@ -0,0 +1,23 @@ +"""One2many excel""" +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-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..3506db929 --- /dev/null +++ b/one2many_excel_report/models/report_excel.py @@ -0,0 +1,83 @@ +"""One2many excel report""" +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-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 SelectReportExcel(models.Model): + """Used to get the Excel report function""" + _name = 'report.excel' + + 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'}) + 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 type(rec[x]) == tuple: + st = ''.join(map(str, rec[x])) + data_list.append({'data': st}) + else: + data_list.append({'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() 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..df8e8e9d5 --- /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_report_excel,access.report.excel,model_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/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/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/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/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/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/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.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.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/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/modules/6.png b/one2many_excel_report/static/description/assets/modules/6.png new file mode 100644 index 000000000..7f2815273 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/modules/barcode.png b/one2many_excel_report/static/description/assets/modules/barcode.png new file mode 100644 index 000000000..618e3e6c4 Binary files /dev/null and b/one2many_excel_report/static/description/assets/modules/barcode.png differ diff --git a/one2many_excel_report/static/description/assets/modules/fatoorah.png b/one2many_excel_report/static/description/assets/modules/fatoorah.png new file mode 100644 index 000000000..991fc77ec Binary files /dev/null and b/one2many_excel_report/static/description/assets/modules/fatoorah.png differ diff --git a/one2many_excel_report/static/description/assets/modules/integration_biometric.png b/one2many_excel_report/static/description/assets/modules/integration_biometric.png new file mode 100644 index 000000000..ed11bd818 Binary files /dev/null and b/one2many_excel_report/static/description/assets/modules/integration_biometric.png differ diff --git a/one2many_excel_report/static/description/assets/modules/product_brand.png b/one2many_excel_report/static/description/assets/modules/product_brand.png new file mode 100644 index 000000000..1d2238b80 Binary files /dev/null and b/one2many_excel_report/static/description/assets/modules/product_brand.png differ diff --git a/one2many_excel_report/static/description/assets/modules/website_cart.png b/one2many_excel_report/static/description/assets/modules/website_cart.png new file mode 100644 index 000000000..163485cfd Binary files /dev/null and b/one2many_excel_report/static/description/assets/modules/website_cart.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..3f88eac60 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..3569c22b9 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..810c960a5 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..f82e0aae0 Binary files /dev/null and b/one2many_excel_report/static/description/assets/screenshots/hero.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..772fe092f 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..d366f0a97 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..6b6eb8360 --- /dev/null +++ b/one2many_excel_report/static/description/index.html @@ -0,0 +1,550 @@ +
+ +
+ +
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+ + + +

One2many + Mass Select/ Deselect Widget

+

Managing Multiple + Selection/Deselection of One2many Fields.

+ + + +
+ + +
+
+ +
+

Explore This + Module

+
+ + + + +
+
+ +
+

Overview +

+
+
+
+ If we want to print the excel report of the one2many fields . +
+
+ + + +
+
+ +
+

Features +

+
+
+
+
+ + + Excel report of the one2many +
+
+
+ + + +
+
+ +
+

Screenshots +

+
+
+
+ +
+

Configuration

+

Add the widget "one2many_excel" for one2many field .

+ +
+ +
+

One2Many Fields

+

After adding the widget in the on2many 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.

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

+ Related + Products +

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

Our Services +

+
+ +
+
+
+
+ +
+
+ Odoo + Customization
+
+ +
+
+ +
+
+ Odoo + Implementation
+
+ +
+
+ +
+
+ Odoo + Support
+
+ + +
+
+ +
+
+ Hire + Odoo + Developer
+
+ +
+
+ +
+
+ Odoo + Integration
+
+ +
+
+ +
+
+ Odoo + Migration
+
+ + +
+
+ +
+
+ Odoo + Consultancy
+
+ +
+
+ +
+
+ Odoo + Implementation
+
+ +
+
+ +
+
+ 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 86068 + 27707

+
+
+
+
+
+
+
+ +
+
+
+ \ No newline at end of file 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..4fcfa7f42 --- /dev/null +++ b/one2many_excel_report/static/src/js/X2ManyField.js @@ -0,0 +1,32 @@ +/** @odoo-module */ +import { X2ManyField } from "@web/views/fields/x2many/x2many_field"; +import { registry } from "@web/core/registry"; +import { ListRenderer } from "@web/views/list/list_renderer"; +export class ExcelListRenderer extends ListRenderer { + setup() { + super.setup(); + } +} +//Extends X2ManyField to create widget +export class ExcelX2ManyField extends X2ManyField { + async Print_excel_report(){ + var model = this.props.record.resModel + var order = this.props.record.data.id + var one2many = this.props.name + var relation=this.activeField.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.env.model.actionService.doAction(action); + } +} +ExcelX2ManyField.components = { + ...X2ManyField.components, ListRenderer: ExcelListRenderer +}; +ExcelX2ManyField.template = "one2many_excel_report.One2manyExcel"; +registry.category("fields").add("one2many_excel", ExcelX2ManyField); \ No newline at end of file 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..1c3a5fad8 --- /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 framework from 'web.framework'; +import session from 'web.session'; +registry.category("ir.actions.report handlers").add("xlsx", async (action) => { +//This is used to check the report type + if (action.report_type === 'xlsx') { + framework.blockUI(); + var self = this; + var def = $.Deferred(); + session.get_file({ + url: '/xlsx_reports', + data: {'id':action.context.id,'field':action.context.field,'current_model':action.context.model}, + success: def.resolve.bind(def), + complete: framework.unblockUI, + }); + return def; + } +}); \ No newline at end of file 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..a79a22258 --- /dev/null +++ b/one2many_excel_report/static/src/xml/X2ManyField.xml @@ -0,0 +1,19 @@ + + + + + +
+ + + + +
+
+
+
+ +