diff --git a/event_management_report/README.rst b/event_management_report/README.rst new file mode 100644 index 000000000..157b24367 --- /dev/null +++ b/event_management_report/README.rst @@ -0,0 +1,26 @@ +=========================== +Event Management Report v10 +=========================== + +Event Management report is a supporting module of Event_management module. +The module helps the user to generate reports of Events. +The user can generate filtered reports and export it to XLS and PDF format. + +Features +======== +* Filtration based on Event type. +* Filtration based on Event state. +* Both PDF and XLS report. + +Contributors +============ + +* Avinash Nk + + +Maintainer +========== + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit https://www.cybrosys.com diff --git a/event_management_report/__init__.py b/event_management_report/__init__.py new file mode 100644 index 000000000..0a866707d --- /dev/null +++ b/event_management_report/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Avinash Nk() +# +# 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 models +from . import report diff --git a/event_management_report/__manifest__.py b/event_management_report/__manifest__.py new file mode 100644 index 000000000..ab8ef1ad1 --- /dev/null +++ b/event_management_report/__manifest__.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Avinash Nk() +# +# 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': 'Event Management Report', + 'version': '10.0.1.0.0', + 'summary': """Generates XLS and PDF Reports of Events in Event Management Module""", + 'description': """Generates XLS and PDF Reports of Events in Event Management Module""", + "category": "Tools", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'depends': ['event_management', 'report_xlsx'], + 'data': ['views/event_report_wizard.xml', + 'report/event_report_pdf.xml', + 'report/event_reports.xml', + ], + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'application': False, +} diff --git a/event_management_report/models/__init__.py b/event_management_report/models/__init__.py new file mode 100644 index 000000000..3dcb3a098 --- /dev/null +++ b/event_management_report/models/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Avinash Nk() +# +# 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 event_report_wizard diff --git a/event_management_report/models/event_report_wizard.py b/event_management_report/models/event_report_wizard.py new file mode 100644 index 000000000..9f1fb27d2 --- /dev/null +++ b/event_management_report/models/event_report_wizard.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Avinash Nk() +# +# 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 import models, fields, api + + +class EventManagement(models.TransientModel): + _name = 'event.management.report' + + event_type = fields.Many2many('event.management.type', 'event_type_rel', 'report_id', 'type_id', string="Type", + required=True) + event_state = fields.Selection([('draft', 'Draft'), ('confirm', 'Confirmed'), ('invoice', 'Invoiced'), + ('close', 'Close'), ('cancel', 'Canceled')], string="State") + + @api.multi + def pdf_report(self): + type_select = self.event_type.ids + state_select = self.event_state + wizard_data = {"type_select": type_select, "state_select": state_select} + return self.env['report'].get_action(self, 'event_management_report.event_report_template', data=wizard_data) + + @api.multi + def xls_report(self): + type_select = self.event_type.ids + state_select = self.event_state + wizard_data = {"type_select": type_select, "state_select": state_select} + return {'type': 'ir.actions.report.xml', + 'report_name': 'event_management_report.event_report.xlsx', + 'report_type': 'xlsx', + 'datas': wizard_data, + 'name': 'Event Report'} diff --git a/event_management_report/report/__init__.py b/event_management_report/report/__init__.py new file mode 100644 index 000000000..7423bf3bf --- /dev/null +++ b/event_management_report/report/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Avinash Nk() +# +# 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 event_report_parser +from . import event_report_xlsx diff --git a/event_management_report/report/event_report_parser.py b/event_management_report/report/event_report_parser.py new file mode 100644 index 000000000..ff44d0cf9 --- /dev/null +++ b/event_management_report/report/event_report_parser.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Avinash Nk() +# +# 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 import models, api + + +class EventReportParser(models.AbstractModel): + _name = 'report.event_management_report.event_report_template' + + @api.model + def render_html(self, docids, data): + filtered_events = self.filtered_records(data) + docargs = { + 'docs': filtered_events, + 'model': self, + 'data': data, + } + return self.env['report'].render('event_management_report.event_report_template', docargs) + + @api.multi + def filtered_records(self, data): + total_events = self.env['event.management'] + type_select = data['type_select'] + state_select = data['state_select'] + domain = [('type_of_event', 'in', type_select)] + if state_select: + domain.append(('state', '=', state_select)) + filtered_events = total_events.search(domain) + return filtered_events diff --git a/event_management_report/report/event_report_pdf.xml b/event_management_report/report/event_report_pdf.xml new file mode 100644 index 000000000..4e9dfba86 --- /dev/null +++ b/event_management_report/report/event_report_pdf.xml @@ -0,0 +1,67 @@ + + + + + + diff --git a/event_management_report/report/event_report_xlsx.py b/event_management_report/report/event_report_xlsx.py new file mode 100644 index 000000000..8e7022581 --- /dev/null +++ b/event_management_report/report/event_report_xlsx.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Avinash Nk() +# +# 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.addons.report_xlsx.report.report_xlsx import ReportXlsx + + +class EventReportXlsx(ReportXlsx): + def generate_xlsx_report(self, workbook, data, obj): + parser_obj = self.env['report.event_management_report.event_report_template'] + filtered_records = parser_obj.filtered_records(data) + sheet = workbook.add_worksheet() + format1 = workbook.add_format({'font_size': 16, 'align': 'center', 'bg_color': '#D3D3D3', 'bold': True}) + format1.set_font_color('#000080') + format2 = workbook.add_format({'font_size': 10, 'bold': True}) + format3 = workbook.add_format({'font_size': 10}) + format1.set_align('center') + format2.set_align('center') + sheet.merge_range('A01:B01', "Name", format2) + sheet.merge_range('C01:D01', "Type", format2) + sheet.merge_range('E01:F01', "Customer", format2) + sheet.merge_range('G01:H01', "Date", format2) + sheet.merge_range('I01:J01', "Start Date", format2) + sheet.merge_range('K01:L01', "End Date", format2) + sheet.merge_range('M01:N01', "State", format2) + row_number = 1 + col_number = 0 + for records in filtered_records: + sheet.merge_range(row_number, col_number, row_number, col_number+1, records.name, format3) + sheet.merge_range(row_number, col_number+2, row_number, col_number+3, records.type_of_event.name, format3) + sheet.merge_range(row_number, col_number+4, row_number, col_number+5, records.partner_id.name, format3) + sheet.merge_range(row_number, col_number+6, row_number, col_number+7, records.date, format3) + sheet.merge_range(row_number, col_number+8, row_number, col_number+9, records.start_date, format3) + sheet.merge_range(row_number, col_number+10, row_number, col_number+11, records.end_date, format3) + sheet.merge_range(row_number, col_number+12, row_number, col_number+13, records.state, format3) + row_number += 1 + + +EventReportXlsx('report.event_management_report.event_report.xlsx', 'event.management') diff --git a/event_management_report/report/event_reports.xml b/event_management_report/report/event_reports.xml new file mode 100644 index 000000000..8b1dc737c --- /dev/null +++ b/event_management_report/report/event_reports.xml @@ -0,0 +1,24 @@ + + + + + + + + + + diff --git a/event_management_report/static/description/banner.jpg b/event_management_report/static/description/banner.jpg new file mode 100644 index 000000000..2d627fa08 Binary files /dev/null and b/event_management_report/static/description/banner.jpg differ diff --git a/event_management_report/static/description/cybro_logo.png b/event_management_report/static/description/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/event_management_report/static/description/cybro_logo.png differ diff --git a/event_management_report/static/description/event_report_pdf.png b/event_management_report/static/description/event_report_pdf.png new file mode 100644 index 000000000..6bc4aa023 Binary files /dev/null and b/event_management_report/static/description/event_report_pdf.png differ diff --git a/event_management_report/static/description/event_report_wizard.png b/event_management_report/static/description/event_report_wizard.png new file mode 100644 index 000000000..2e2ca492f Binary files /dev/null and b/event_management_report/static/description/event_report_wizard.png differ diff --git a/event_management_report/static/description/event_report_xls.png b/event_management_report/static/description/event_report_xls.png new file mode 100644 index 000000000..fc5a45c5b Binary files /dev/null and b/event_management_report/static/description/event_report_xls.png differ diff --git a/event_management_report/static/description/icon.png b/event_management_report/static/description/icon.png new file mode 100644 index 000000000..21967b20e Binary files /dev/null and b/event_management_report/static/description/icon.png differ diff --git a/event_management_report/static/description/index.html b/event_management_report/static/description/index.html new file mode 100644 index 000000000..dfc89ad34 --- /dev/null +++ b/event_management_report/static/description/index.html @@ -0,0 +1,85 @@ +
+
+
+

Event Management Report

+

PDF and XLS Report of Events.

+

Cybrosys Technologies

+
+
+

Major Features:

+
    +
  •    Filtration based on Event type.
  • +
  •    Filtration based on Event state.
  • +
  •    Both PDF and XLS report.
  • +
+
+
+
+ +
+
+
+

Overview

+

Event Management report is a supporting module of Event_management module. The module helps the user to generate reports of Events. The user can generate filtered reports and export it to XLS and PDF format.

+
+
+
+ +
+
+
+

Report Wizard

+
+ +
+
+
+
+ +
+
+
+

PDF Report

+
+ +
+
+
+
+ +
+
+
+

XLS Report

+
+ +
+
+
+
+ +
+

Need Any Help?

+ +
diff --git a/event_management_report/views/event_report_wizard.xml b/event_management_report/views/event_report_wizard.xml new file mode 100644 index 000000000..0383f8cf1 --- /dev/null +++ b/event_management_report/views/event_report_wizard.xml @@ -0,0 +1,44 @@ + + + + + + event_report_form_view.form + event.management.report + +
+ + + + + + + + + + +
+
+
+
+
+ + + Event Report + event.management.report + ir.actions.act_window + form + form + new + + + + + +
+
\ No newline at end of file