diff --git a/project_report_pdf/README.rst b/project_report_pdf/README.rst new file mode 100644 index 000000000..d8f323c53 --- /dev/null +++ b/project_report_pdf/README.rst @@ -0,0 +1,23 @@ +Project Report v14 +================== +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 +* Developer V14: Muhammed P @ 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..afd96d536 --- /dev/null +++ b/project_report_pdf/__manifest__.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2020-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': '14.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 14, Odoo14""", + 'depends': ['base', 'project'], + 'license': 'AGPL-3', + 'data': ['security/ir.model.access.csv', + '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..1f30dee53 --- /dev/null +++ b/project_report_pdf/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 3.10.2020 +#### Version 14.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/security/ir.model.access.csv b/project_report_pdf/security/ir.model.access.csv new file mode 100644 index 000000000..3e5157f58 --- /dev/null +++ b/project_report_pdf/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_wizard_project_report,wizard.project.report,model_wizard_project_report,,1,1,1,1 \ 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..c27dae311 Binary files /dev/null and b/project_report_pdf/static/description/banner.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..d01fcdb30 Binary files /dev/null and b/project_report_pdf/static/description/icon.png differ diff --git a/project_report_pdf/static/description/images/PDF report.png b/project_report_pdf/static/description/images/PDF report.png new file mode 100644 index 000000000..4275a2cfa Binary files /dev/null and b/project_report_pdf/static/description/images/PDF report.png differ diff --git a/project_report_pdf/static/description/images/PDF_report-1.png b/project_report_pdf/static/description/images/PDF_report-1.png new file mode 100644 index 000000000..e7a4f12f5 Binary files /dev/null and b/project_report_pdf/static/description/images/PDF_report-1.png differ diff --git a/project_report_pdf/static/description/images/XLS report.png b/project_report_pdf/static/description/images/XLS report.png new file mode 100644 index 000000000..bfeccf8b4 Binary files /dev/null and b/project_report_pdf/static/description/images/XLS report.png differ diff --git a/project_report_pdf/static/description/images/checked.png b/project_report_pdf/static/description/images/checked.png new file mode 100644 index 000000000..578cedb80 Binary files /dev/null and b/project_report_pdf/static/description/images/checked.png differ diff --git a/project_report_pdf/static/description/images/coupon_pos.png b/project_report_pdf/static/description/images/coupon_pos.png new file mode 100644 index 000000000..cf274c0bb Binary files /dev/null and b/project_report_pdf/static/description/images/coupon_pos.png differ diff --git a/project_report_pdf/static/description/images/cybrosys.png b/project_report_pdf/static/description/images/cybrosys.png new file mode 100644 index 000000000..d76b5bafb Binary files /dev/null and b/project_report_pdf/static/description/images/cybrosys.png differ diff --git a/project_report_pdf/static/description/images/filter report.png b/project_report_pdf/static/description/images/filter report.png new file mode 100644 index 000000000..b2c9d619d Binary files /dev/null and b/project_report_pdf/static/description/images/filter report.png differ diff --git a/project_report_pdf/static/description/images/pos_6.png b/project_report_pdf/static/description/images/pos_6.png new file mode 100644 index 000000000..98673039e Binary files /dev/null and b/project_report_pdf/static/description/images/pos_6.png differ diff --git a/project_report_pdf/static/description/images/pos_image.png b/project_report_pdf/static/description/images/pos_image.png new file mode 100644 index 000000000..84ebada90 Binary files /dev/null and b/project_report_pdf/static/description/images/pos_image.png differ diff --git a/project_report_pdf/static/description/images/pos_logo.png b/project_report_pdf/static/description/images/pos_logo.png new file mode 100644 index 000000000..97d6c5041 Binary files /dev/null and b/project_report_pdf/static/description/images/pos_logo.png differ diff --git a/project_report_pdf/static/description/images/pos_reprint.png b/project_report_pdf/static/description/images/pos_reprint.png new file mode 100644 index 000000000..65a113e60 Binary files /dev/null and b/project_report_pdf/static/description/images/pos_reprint.png differ diff --git a/project_report_pdf/static/description/images/pos_waiter.png b/project_report_pdf/static/description/images/pos_waiter.png new file mode 100644 index 000000000..6055ffc67 Binary files /dev/null and b/project_report_pdf/static/description/images/pos_waiter.png differ diff --git a/project_report_pdf/static/description/images/project.png b/project_report_pdf/static/description/images/project.png new file mode 100644 index 000000000..2c8ce12f4 Binary files /dev/null and b/project_report_pdf/static/description/images/project.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..62c7bfff5 --- /dev/null +++ b/project_report_pdf/static/description/index.html @@ -0,0 +1,318 @@ +
cybrosys-logo
+
+
+
+

Project Report PDF & XLS

+

+
+

Key Highlights

+
    +
  • PDF Reports in Project.
  • +
  • XLS Reports in Project.
  • +
  • Detailed Report on Tasks.
  • +
  • Advanced Filters for Report.
  • +
+
+ + + +
+ + +
+
+
+
+
+ +
+
+ +

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

+
+ +

Project Report PDF & XLS

+
+
    +

    + PDF Reports in Project. +

    + +

    + XLS Reports in Project. +

    + +

    + Detailed Report on Tasks. +

    + +

    + Advanced Filters for Report. +

    +
+
+ +
+
+

Screenshots

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

Suggested Products

+
+ +
+
+

Our Service

+
+ +
+
+
+

Our Industries

+
+ +
+
+
+ +
+
+

Trading

+

Easily procure and sell your products.

+
+
+
+
+ +
+
+

Manufacturing

+

Plan, track and schedule your operations.

+
+
+
+
+ +
+
+

Restaurant

+

Run your bar or restaurant methodical.

+
+
+
+
+ +
+
+

POS

+

Easy configuring and convivial selling.

+
+
+
+
+ +
+
+

E-commerce & Website

+

Mobile friendly, awe-inspiring product pages.

+
+
+
+
+ +
+
+

Hotel Management

+

An all-inclusive hotel management application.

+
+
+
+
+ +
+
+

Education

+

A Collaborative platform for educational management.

+
+
+
+
+ +
+
+

Service Management

+

Keep track of services and invoice accordingly.

+
+
+
+
+
+ +
+
+
+

Need Any Help?

+
+

If you have anything to share with us based on your use of this module, please let us know. We are ready to offer our support.

+
+

Email us

+

odoo@cybrosys.com / info@cybrosys.com

+
+
+

Contact Us

+ www.cybrosys.com +
+
+
+
+
+
+
+
+
+ +
+ + + + + + + +
+
+
+ \ No newline at end of file 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..420ae6b26 --- /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 + * 'xlsx' 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.report'. + * + * @private + * @param {Object} action the description of the action to execute + * @param {Object} options @see doAction for details + * @returns {Promise} resolved when the action has been executed + */ + _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.report' actions. + * + * @override + * @private + */ + _executeReportAction: function (action, options) { + if (action.report_type === 'xlsx') { + 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 @@ + + + +