diff --git a/project_report_pdf/README.rst b/project_report_pdf/README.rst new file mode 100644 index 000000000..5e57f479a --- /dev/null +++ b/project_report_pdf/README.rst @@ -0,0 +1,22 @@ +Project Report v13 +================== +PDF and XLS Reports for Project Module. + + +Features +======== +* Project Task Report XLS [With advanced Filtration] +* Project Task Report PDF [With advanced Filtration] + +Credits +======= +Cybrosys Techno Solutions + +Author +------ +* Developer v9: Avinash Nk @ cybrosys +* Developer v10: Treesa @ cybrosys +* Developer V11: Akshay @ cybrosys +* Developer V12: Akshay @ cybrosys +* Developer V13: Vinaya S B @ cybrosys + diff --git a/project_report_pdf/__init__.py b/project_report_pdf/__init__.py new file mode 100644 index 000000000..7c5d56d68 --- /dev/null +++ b/project_report_pdf/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# Author: Akshay Babu() +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +from . import wizard +from . import controllers +from . import report + diff --git a/project_report_pdf/__manifest__.py b/project_report_pdf/__manifest__.py new file mode 100644 index 000000000..dffd4838b --- /dev/null +++ b/project_report_pdf/__manifest__.py @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +{ + 'name': 'Project Report XLS & PDF', + 'version': '13.0.1.0.0', + "category": "Project", + 'author': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'maintainer': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'summary': """Advanced PDF & XLS Reports for Project With Filtrations""", + 'description': """Advanced PDF & XLS Reports for Project With Filtrations, Odoo 13, Odoo13""", + 'depends': ['base', 'project'], + 'license': 'AGPL-3', + 'data': ['views/action_manager.xml', + 'wizard/project_report_wizard_view.xml', + 'report/project_report_pdf_view.xml', + 'views/project_report_button.xml', + 'views/project_report.xml' + ], + 'images': ['static/description/banner.png'], + 'installable': True, + 'auto_install': False, +} diff --git a/project_report_pdf/controllers/__init__.py b/project_report_pdf/controllers/__init__.py new file mode 100644 index 000000000..deec4a8b8 --- /dev/null +++ b/project_report_pdf/controllers/__init__.py @@ -0,0 +1 @@ +from . import main \ No newline at end of file diff --git a/project_report_pdf/controllers/main.py b/project_report_pdf/controllers/main.py new file mode 100644 index 000000000..4af38b464 --- /dev/null +++ b/project_report_pdf/controllers/main.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- + +import json +from odoo import http +from odoo.http import content_disposition, request +from odoo.addons.web.controllers.main import _serialize_exception +from odoo.tools import html_escape + + +class XLSXReportController(http.Controller): + + @http.route('/xlsx_reports', type='http', auth='user', methods=['POST'], csrf=False) + def get_report_xlsx(self, model, options, output_format, token, report_name, **kw): + uid = request.session.uid + report_obj = request.env[model].with_user(uid) + options = json.loads(options) + 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(options, response) + response.set_cookie('fileToken', token) + return response + except Exception as e: + se = _serialize_exception(e) + error = { + 'code': 200, + 'message': 'Odoo Server Error', + 'data': se + } + return request.make_response(html_escape(json.dumps(error))) \ No newline at end of file diff --git a/project_report_pdf/doc/RELEASE_NOTES.md b/project_report_pdf/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..3acfe905c --- /dev/null +++ b/project_report_pdf/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 2.11.2019 +#### Version 13.0.1.0.0 +##### ADD +- Initial commit for project_report_pdf + diff --git a/project_report_pdf/report/__init__.py b/project_report_pdf/report/__init__.py new file mode 100644 index 000000000..660f478e8 --- /dev/null +++ b/project_report_pdf/report/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# Author: Akshay Babu() +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +from . import project_report_pdf diff --git a/project_report_pdf/report/project_report_pdf.py b/project_report_pdf/report/project_report_pdf.py new file mode 100644 index 000000000..d520cce4f --- /dev/null +++ b/project_report_pdf/report/project_report_pdf.py @@ -0,0 +1,80 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### + +from odoo.http import request +from odoo import models, api + + +class ProjectReportParser(models.AbstractModel): + _name = 'report.project_report_pdf.project_report_template' + + def _get_report_values(self, docids, data=None): + name = data['record'] + wizard_record = request.env['wizard.project.report'].search([])[-1] + task_obj = request.env['project.task'] + users_selected = [] + stages_selected = [] + for elements in wizard_record.partner_select: + users_selected.append(elements.id) + for elements in wizard_record.stage_select: + stages_selected.append(elements.id) + if wizard_record.partner_select: + if wizard_record.stage_select: + current_task = task_obj.search([('project_id', '=', name), + ('user_id', 'in', users_selected), + ('stage_id', 'in', stages_selected)]) + + else: + current_task = task_obj.search([('project_id', '=', name), + ('user_id', 'in', users_selected)]) + + else: + if wizard_record.stage_select: + current_task = task_obj.search([('project_id', '=', name), + ('stage_id', 'in', stages_selected)]) + else: + current_task = task_obj.search([('project_id', '=', name)]) + vals = [] + for i in current_task: + vals.append({ + 'name': i.name, + 'user_id': i.user_id.name, + 'stage_id': i.stage_id.name, + }) + if current_task: + return { + 'vals': vals, + 'name': current_task[0].project_id.name, + 'manager': current_task[0].project_id.user_id.name, + 'date_start': current_task[0].project_id.date_start, + 'date_end': current_task[0].project_id.date, + } + else: + return { + 'vals': vals, + 'name': current_task.project_id.name, + 'manager': current_task.project_id.user_id.name, + 'date_start': current_task.project_id.date_start, + 'date_end': current_task.project_id.date, + } + + + + diff --git a/project_report_pdf/report/project_report_pdf_view.xml b/project_report_pdf/report/project_report_pdf_view.xml new file mode 100644 index 000000000..5a2978b13 --- /dev/null +++ b/project_report_pdf/report/project_report_pdf_view.xml @@ -0,0 +1,44 @@ + + + + \ No newline at end of file diff --git a/project_report_pdf/static/description/banner.png b/project_report_pdf/static/description/banner.png new file mode 100644 index 000000000..3c430a7eb Binary files /dev/null and b/project_report_pdf/static/description/banner.png differ diff --git a/project_report_pdf/static/description/cybro_logo.png b/project_report_pdf/static/description/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/project_report_pdf/static/description/cybro_logo.png differ diff --git a/project_report_pdf/static/description/icon.png b/project_report_pdf/static/description/icon.png new file mode 100644 index 000000000..954404fbd Binary files /dev/null and b/project_report_pdf/static/description/icon.png differ diff --git a/project_report_pdf/static/description/index.html b/project_report_pdf/static/description/index.html new file mode 100644 index 000000000..c31ed3856 --- /dev/null +++ b/project_report_pdf/static/description/index.html @@ -0,0 +1,355 @@ +
+
+

+ Project Report PDF & XLS +

+
+ Cybrosys Technologies +
+ +
+ cybrosys technologies +
+
+
+
+
+
+

+ Overview +

+

+ This module enhances the project management with intuitive reports. + Reports consist of task details with respect to the selected project. + The user can use the filter facilities from report wizard to get the optimized reports. +

+
+
+ +
+
+

+ Features +

+

+ + PDF Reports in Project. +

+

+ + XLS Reports in Project. +

+

+ + Detailed Report on Tasks. +

+

+ + Advanced Filters for Report. +

+
+
+ +
+
+

+ Screenshots +

+

+ + Go to Project -> Project +

+
+ +
+

+ + You can filter the project report via selecting the appropriate options from the wizard. +

+
+ +
+

+ + PDF Report Of Data Import/Export Plugin Project. +

+
+ +
+

+ + Excel Report Of Data Import/Export Plugin Project. +

+
+ +
+
+
+ +
+
+ cybrosys technologies +
+
+
+
+

+ Our Services +

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

+ + Odoo Support +

+ +
+ +
+
+
+
+
+

+ Our Industries +

+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Trading + +

+

+ Easily procure and sell your products. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Manufacturing +

+

+ Plan, track and schedule your operations. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Restaurant +

+

+ Run your bar or restaurant methodical. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + POS +

+

+ Easy configuring and convivial selling. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + E-commerce & Website +

+

+ Mobile friendly, awe-inspiring product pages. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Hotel Management +

+

+ An all-inclusive hotel management application. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Education +

+

+ A Collaborative platform for educational management. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Service Management +

+

+ Keep track of services and invoice accordingly. +

+
+
+
+
+
+
+ +
+ + diff --git a/project_report_pdf/static/description/project-report-cybrosys-1.png b/project_report_pdf/static/description/project-report-cybrosys-1.png new file mode 100644 index 000000000..fe25a4dce Binary files /dev/null and b/project_report_pdf/static/description/project-report-cybrosys-1.png differ diff --git a/project_report_pdf/static/description/project-report-cybrosys-2.png b/project_report_pdf/static/description/project-report-cybrosys-2.png new file mode 100644 index 000000000..da15045bf Binary files /dev/null and b/project_report_pdf/static/description/project-report-cybrosys-2.png differ diff --git a/project_report_pdf/static/description/project-report-cybrosys-3.png b/project_report_pdf/static/description/project-report-cybrosys-3.png new file mode 100644 index 000000000..1e6e4699f Binary files /dev/null and b/project_report_pdf/static/description/project-report-cybrosys-3.png differ diff --git a/project_report_pdf/static/description/project-report-cybrosys-4.png b/project_report_pdf/static/description/project-report-cybrosys-4.png new file mode 100644 index 000000000..ac86d2f41 Binary files /dev/null and b/project_report_pdf/static/description/project-report-cybrosys-4.png differ diff --git a/project_report_pdf/static/src/js/action_manager.js b/project_report_pdf/static/src/js/action_manager.js new file mode 100644 index 000000000..8fc80e722 --- /dev/null +++ b/project_report_pdf/static/src/js/action_manager.js @@ -0,0 +1,48 @@ +odoo.define('project_report_pdf.action_manager', function (require) { +"use strict"; +/** + * The purpose of this file is to add the actions of type + * 'ir_actions_xlsx_download' to the ActionManager. + */ + +var ActionManager = require('web.ActionManager'); +var framework = require('web.framework'); +var session = require('web.session'); + + +ActionManager.include({ + + /** + * Executes actions of type 'ir_actions_xlsx_download'. + * + * @private + * @param {Object} action the description of the action to execute + * @returns {Deferred} resolved when the report has been downloaded ; + * rejected if an error occurred during the report generation + */ + _executexlsxReportDownloadAction: function (action) { + framework.blockUI(); + var def = $.Deferred(); + session.get_file({ + url: '/xlsx_reports', + data: action.data, + success: def.resolve.bind(def), + complete: framework.unblockUI, + }); + return def; + }, + /** + * Overrides to handle the 'ir_actions_xlsx_download' actions. + * + * @override + * @private + */ + _handleAction: function (action, options) { + if (action.type === 'ir_actions_xlsx_download') { + return this._executexlsxReportDownloadAction(action, options); + } + return this._super.apply(this, arguments); + }, +}); + +}); diff --git a/project_report_pdf/views/action_manager.xml b/project_report_pdf/views/action_manager.xml new file mode 100644 index 000000000..21b670d75 --- /dev/null +++ b/project_report_pdf/views/action_manager.xml @@ -0,0 +1,10 @@ + + + +