diff --git a/export_view_pdf/README.rst b/export_view_pdf/README.rst new file mode 100644 index 000000000..c82d53907 --- /dev/null +++ b/export_view_pdf/README.rst @@ -0,0 +1,41 @@ +Export View PDF 15 +================== +* Export current List view in PDF format + +Installation +============ + - www.odoo.com/documentation/15.0/setup/install.html + - Install our custom addon + +License +------- +General Public License, Version 3 (LGPL v3). +(https://www.odoo.com/documentation/user/15.0/legal/licenses/licenses.html) + +Company +------- +* 'Cybrosys Techno Solutions `__ + +Credits +------- +* Developer: +(v15) shamsad @ Cybrosys + + +Contacts +-------- +* Mail Contact : odoo@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 +========== +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit https://www.cybrosys.com + +Further information +=================== +HTML Description: ``__ \ No newline at end of file diff --git a/export_view_pdf/__init__.py b/export_view_pdf/__init__.py new file mode 100644 index 000000000..57ebd6793 --- /dev/null +++ b/export_view_pdf/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-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 diff --git a/export_view_pdf/__manifest__.py b/export_view_pdf/__manifest__.py new file mode 100644 index 000000000..c0a2e1118 --- /dev/null +++ b/export_view_pdf/__manifest__.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-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': "Export View PDF", + 'description': """Export View PDF""", + 'summary': """Export Current List View in PDF Format """, + 'version': '15.0.1.0.0', + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'depends': ['base', 'account'], + 'data': + [ + 'views/pdf.xml', + 'views/pdf_group_by_template.xml' + ], + 'assets': { + 'web.assets_qweb': [ + 'export_view_pdf/static/src/xml/button_view.xml', + ], + 'web.assets_backend': [ + 'export_view_pdf/static/src/js/pdf_export.js' + ] + }, + 'images': [ + 'static/description/banner.png' + ], + 'license': 'LGPL-3', + 'installable': True, + 'application': False, + 'auto_install': False, +} diff --git a/export_view_pdf/controllers/__init__.py b/export_view_pdf/controllers/__init__.py new file mode 100644 index 000000000..b2a2bc71e --- /dev/null +++ b/export_view_pdf/controllers/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-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 main diff --git a/export_view_pdf/controllers/main.py b/export_view_pdf/controllers/main.py new file mode 100644 index 000000000..1003bb837 --- /dev/null +++ b/export_view_pdf/controllers/main.py @@ -0,0 +1,65 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-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 odoo import http +from odoo.http import request + + +class ExportData(http.Controller): + @http.route('/get_data', auth="user", type='json') + def get_export_data(self, **kw): + """ + controller to fetch required retails + """ + field = kw['field'] + model = kw['model'] + Model = request.env[model] + res_ids = kw['res_ids'] + field_label = kw['exported_fields'] + columns_headers = [val['label'].strip() for val in field_label] + records = request.env[model].browse(res_ids) + + if kw['grouped_by']: + field_names = [f for f in kw['field']] + groupby_type = [Model._fields[x.split(':')[0]].type for x in + kw['grouped_by']] + domain = kw['domain'] + + groups_data = Model.sudo().read_group(domain, + field_names, kw['grouped_by'], + lazy=False) + group_by = [] + for rec in groups_data: + ids = Model.search(rec['__domain']) + list_key = [x for x in rec.keys() if + x in kw['field'] and x not in kw['grouped_by']] + new_export_data = [ids.export_data(field).get('datas', [])] + group_tuple = ( + {'count': rec['__count']}, rec.get(kw['grouped_by'][0]), + new_export_data, + [(rec[x], field.index(x)) for x in list_key]) + group_by.append(group_tuple) + return {'header': columns_headers, 'data': new_export_data, + 'type': groupby_type, 'other': group_by} + else: + new_export_data = records.export_data(field).get('datas', []) + return {'data': new_export_data, 'header': columns_headers} diff --git a/export_view_pdf/doc/RELEASE_NOTES.md b/export_view_pdf/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..26061f17d --- /dev/null +++ b/export_view_pdf/doc/RELEASE_NOTES.md @@ -0,0 +1,8 @@ +## Module + +#### 01.10.2022 +#### Version 15.0.1.0.0 +#### ADD +- Initial commit for export_view_pdf + + diff --git a/export_view_pdf/static/description/assets/icons/check.png b/export_view_pdf/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/export_view_pdf/static/description/assets/icons/check.png differ diff --git a/export_view_pdf/static/description/assets/icons/chevron.png b/export_view_pdf/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/export_view_pdf/static/description/assets/icons/chevron.png differ diff --git a/export_view_pdf/static/description/assets/icons/cogs.png b/export_view_pdf/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/export_view_pdf/static/description/assets/icons/cogs.png differ diff --git a/export_view_pdf/static/description/assets/icons/consultation.png b/export_view_pdf/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/export_view_pdf/static/description/assets/icons/consultation.png differ diff --git a/export_view_pdf/static/description/assets/icons/ecom-black.png b/export_view_pdf/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/export_view_pdf/static/description/assets/icons/ecom-black.png differ diff --git a/export_view_pdf/static/description/assets/icons/education-black.png b/export_view_pdf/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/export_view_pdf/static/description/assets/icons/education-black.png differ diff --git a/export_view_pdf/static/description/assets/icons/hotel-black.png b/export_view_pdf/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/export_view_pdf/static/description/assets/icons/hotel-black.png differ diff --git a/export_view_pdf/static/description/assets/icons/license.png b/export_view_pdf/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/export_view_pdf/static/description/assets/icons/license.png differ diff --git a/export_view_pdf/static/description/assets/icons/lifebuoy.png b/export_view_pdf/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/export_view_pdf/static/description/assets/icons/lifebuoy.png differ diff --git a/export_view_pdf/static/description/assets/icons/logo.png b/export_view_pdf/static/description/assets/icons/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/export_view_pdf/static/description/assets/icons/logo.png differ diff --git a/export_view_pdf/static/description/assets/icons/manufacturing-black.png b/export_view_pdf/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/export_view_pdf/static/description/assets/icons/manufacturing-black.png differ diff --git a/export_view_pdf/static/description/assets/icons/pos-black.png b/export_view_pdf/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/export_view_pdf/static/description/assets/icons/pos-black.png differ diff --git a/export_view_pdf/static/description/assets/icons/puzzle.png b/export_view_pdf/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/export_view_pdf/static/description/assets/icons/puzzle.png differ diff --git a/export_view_pdf/static/description/assets/icons/restaurant-black.png b/export_view_pdf/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/export_view_pdf/static/description/assets/icons/restaurant-black.png differ diff --git a/export_view_pdf/static/description/assets/icons/service-black.png b/export_view_pdf/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/export_view_pdf/static/description/assets/icons/service-black.png differ diff --git a/export_view_pdf/static/description/assets/icons/trading-black.png b/export_view_pdf/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/export_view_pdf/static/description/assets/icons/trading-black.png differ diff --git a/export_view_pdf/static/description/assets/icons/training.png b/export_view_pdf/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/export_view_pdf/static/description/assets/icons/training.png differ diff --git a/export_view_pdf/static/description/assets/icons/update.png b/export_view_pdf/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/export_view_pdf/static/description/assets/icons/update.png differ diff --git a/export_view_pdf/static/description/assets/icons/user.png b/export_view_pdf/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/export_view_pdf/static/description/assets/icons/user.png differ diff --git a/export_view_pdf/static/description/assets/icons/wrench.png b/export_view_pdf/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/export_view_pdf/static/description/assets/icons/wrench.png differ diff --git a/export_view_pdf/static/description/assets/modules/budget_image.png b/export_view_pdf/static/description/assets/modules/budget_image.png new file mode 100644 index 000000000..b50130c7d Binary files /dev/null and b/export_view_pdf/static/description/assets/modules/budget_image.png differ diff --git a/export_view_pdf/static/description/assets/modules/credit_image.png b/export_view_pdf/static/description/assets/modules/credit_image.png new file mode 100644 index 000000000..3ad04ecfd Binary files /dev/null and b/export_view_pdf/static/description/assets/modules/credit_image.png differ diff --git a/export_view_pdf/static/description/assets/modules/employee_image.png b/export_view_pdf/static/description/assets/modules/employee_image.png new file mode 100644 index 000000000..30ad58232 Binary files /dev/null and b/export_view_pdf/static/description/assets/modules/employee_image.png differ diff --git a/export_view_pdf/static/description/assets/modules/export_image.png b/export_view_pdf/static/description/assets/modules/export_image.png new file mode 100644 index 000000000..492980ad0 Binary files /dev/null and b/export_view_pdf/static/description/assets/modules/export_image.png differ diff --git a/export_view_pdf/static/description/assets/modules/gantt_image.png b/export_view_pdf/static/description/assets/modules/gantt_image.png new file mode 100644 index 000000000..1ae7cfe3b Binary files /dev/null and b/export_view_pdf/static/description/assets/modules/gantt_image.png differ diff --git a/export_view_pdf/static/description/assets/modules/quotation_image.png b/export_view_pdf/static/description/assets/modules/quotation_image.png new file mode 100644 index 000000000..499b1a72f Binary files /dev/null and b/export_view_pdf/static/description/assets/modules/quotation_image.png differ diff --git a/export_view_pdf/static/description/assets/screenshots/Screenshot1.png b/export_view_pdf/static/description/assets/screenshots/Screenshot1.png new file mode 100644 index 000000000..482abff19 Binary files /dev/null and b/export_view_pdf/static/description/assets/screenshots/Screenshot1.png differ diff --git a/export_view_pdf/static/description/assets/screenshots/Screenshot2.png b/export_view_pdf/static/description/assets/screenshots/Screenshot2.png new file mode 100644 index 000000000..da62d76d3 Binary files /dev/null and b/export_view_pdf/static/description/assets/screenshots/Screenshot2.png differ diff --git a/export_view_pdf/static/description/assets/screenshots/hero.gif b/export_view_pdf/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..3d72eaacd Binary files /dev/null and b/export_view_pdf/static/description/assets/screenshots/hero.gif differ diff --git a/export_view_pdf/static/description/banner.jpg b/export_view_pdf/static/description/banner.jpg new file mode 100644 index 000000000..f3e01b38c Binary files /dev/null and b/export_view_pdf/static/description/banner.jpg differ diff --git a/export_view_pdf/static/description/icon.png b/export_view_pdf/static/description/icon.png new file mode 100644 index 000000000..7c54bca6b Binary files /dev/null and b/export_view_pdf/static/description/icon.png differ diff --git a/export_view_pdf/static/description/index.html b/export_view_pdf/static/description/index.html new file mode 100644 index 000000000..252cca3e3 --- /dev/null +++ b/export_view_pdf/static/description/index.html @@ -0,0 +1,530 @@ +
+
+
+
+ +
+
+
+ Community +
+
+
+
+
+ +
+
+
+

+ Export View PDF

+

+ A Module For Exporting View in PDF Format +

+ +
+
+ + + +
+
+

+ Overview +

+
+ +
+

+ Since the PDF file format became an open standard in 2008, it has seen extensive support in all kinds of apps today. + Here in the Export View PDF App, We can export the corresponding tree view in PDF Format. + In Odoo currently we can export the List view in Excel format, by using Export View PDF App + we can export it in PDF Format. +

+
+

+ +
+ + +
+
+

+ Features +

+
+ +
+
+ +
+
+

+ Export Tree View in PDF Format

+
+
+
+ +
+
+

+ Screenshots +

+
+
+

+ Export PDF button in List View

+

+ From the List View user can see a button Export Pdf

+ +
+ +
+

+ PDF of corresponding List view

+

+ On clicking the Button corresponding List view will be exported in PDF Format +

+ +
+
+ +
+
+

Suggested 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

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

Need Help?

+
+
+
+ + +
+ +
+ + +
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+
+ + +
\ No newline at end of file diff --git a/export_view_pdf/static/src/js/pdf_export.js b/export_view_pdf/static/src/js/pdf_export.js new file mode 100644 index 000000000..0daf347c3 --- /dev/null +++ b/export_view_pdf/static/src/js/pdf_export.js @@ -0,0 +1,58 @@ +odoo.define('export_pdf.print_pdf',function(require){ + "use strict"; +var config = require('web.config'); +var core = require('web.core'); +var ListController = require('web.ListController'); +var ajax = require('web.ajax'); +ListController.include({ + renderButtons: function($node) { + this._super.apply(this, arguments); + if (this.$buttons) { + this.$buttons.find('.o_list_export_pdf').click(this.proxy('action_def')) ; + } + }, + action_def: function () { + var self=this; + var fields=this._getExportDialogWidget().defaultExportFields; + let exported_fields = this._getExportDialogWidget().defaultExportFields.map(field => ({ + name: field, + label: this._getExportDialogWidget().record.fields[field].string, + })); + let groupedBy = this.renderer.state.groupedBy; + var length_field = Array.from(Array(fields.length).keys()); + var records=this._getExportDialogWidget().record.res_ids + var data_len=Array.from(Array(records.length).keys()); + var group_length=Array.from(Array(self.renderer.state.groupsCount).keys()); + ajax.jsonRpc('/get_data','call',{ + 'field':fields, + 'model':this._getExportDialogWidget().record.model, + 'res_ids':records, + 'exported_fields':exported_fields, + 'grouped_by':groupedBy, + 'grouped_by_ids': this.initialState.res_ids, + 'amount': this.renderer.state.data.map(({aggregateValues}) =>aggregateValues), + 'domain':this._getExportDialogWidget().record.domain + }) + .then( function (data){ + if (groupedBy[0]){ + + var action = { + 'type': 'ir.actions.report', + 'report_type': 'qweb-pdf', + 'report_name':'export_view_pdf.export_in_pdf_group_by', + 'data':{'length':length_field,'group_len':group_length,'record':data,} + }; + } + else{ + var action = { + 'type': 'ir.actions.report', + 'report_type': 'qweb-pdf', + 'report_name':'export_view_pdf.export_in_pdf', + 'data':{'length':length_field,'data_len':data_len,'record':data} + }; + } + return self.do_action(action); + }); + } + }); + }); \ No newline at end of file diff --git a/export_view_pdf/static/src/xml/button_view.xml b/export_view_pdf/static/src/xml/button_view.xml new file mode 100644 index 000000000..d8787f0e1 --- /dev/null +++ b/export_view_pdf/static/src/xml/button_view.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/export_view_pdf/views/pdf.xml b/export_view_pdf/views/pdf.xml new file mode 100644 index 000000000..53032bf45 --- /dev/null +++ b/export_view_pdf/views/pdf.xml @@ -0,0 +1,33 @@ + + + Export + ir.exports + qweb-pdf + export_view_pdf.export_in_pdf + + + \ No newline at end of file diff --git a/export_view_pdf/views/pdf_group_by_template.xml b/export_view_pdf/views/pdf_group_by_template.xml new file mode 100644 index 000000000..a84aa4bc9 --- /dev/null +++ b/export_view_pdf/views/pdf_group_by_template.xml @@ -0,0 +1,61 @@ + + + Export + ir.exports + qweb-pdf + export_view_pdf.export_in_pdf_group_by + + + \ No newline at end of file