@ -0,0 +1,26 @@ |
|||||
|
Project Report v10 |
||||
|
================== |
||||
|
PDF and XLS Reports for Project Module. |
||||
|
|
||||
|
|
||||
|
Features |
||||
|
======== |
||||
|
* Project Tasks & Issues Report XLS [With advanced Filtration] |
||||
|
* Project Tasks & Issues Report PDF [With advanced Filtration] |
||||
|
|
||||
|
Installation |
||||
|
============ |
||||
|
To install this module, you need also the **report_xlsx** |
||||
|
module located in: |
||||
|
https://github.com/OCA/reporting-engine/tree/9.0/report_xlsx |
||||
|
|
||||
|
Credits |
||||
|
======= |
||||
|
Cybrosys Techno Solutions <www.cybrosys.com> |
||||
|
|
||||
|
Author |
||||
|
------ |
||||
|
* Developer v9: Avinash Nk @ cybrosys |
||||
|
* Developer v10: Treesa @ cybrosys |
||||
|
* Guidance: Nilmar Shereef @ cybrosys, shereef@cybrosys.in |
||||
|
|
@ -0,0 +1,23 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
################################################################################### |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
||||
|
# Author: Nilmar Shereef(<https://www.cybrosys.com>) |
||||
|
# |
||||
|
# 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 <https://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
################################################################################### |
||||
|
import models |
||||
|
import report |
@ -0,0 +1,42 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
################################################################################### |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
||||
|
# Author: Nilmar Shereef(<https://www.cybrosys.com>) |
||||
|
# |
||||
|
# 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 <https://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
################################################################################### |
||||
|
{ |
||||
|
'name': 'Project Report XLS & PDF', |
||||
|
'version': '10.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""", |
||||
|
'depends': ['base', 'project', 'project_issue', 'report_xlsx'], |
||||
|
'license': 'AGPL-3', |
||||
|
'data': [ |
||||
|
'views/wizard_report.xml', |
||||
|
'views/project_report_pdf_view.xml', |
||||
|
'views/project_report_button.xml', |
||||
|
'views/project_report.xml' |
||||
|
], |
||||
|
'images': ['static/description/banner.jpg'], |
||||
|
'installable': True, |
||||
|
'auto_install': False, |
||||
|
} |
@ -0,0 +1,23 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
################################################################################### |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
||||
|
# Author: Nilmar Shereef(<https://www.cybrosys.com>) |
||||
|
# |
||||
|
# 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 <https://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
################################################################################### |
||||
|
import project_report |
||||
|
import project_report_parser |
@ -0,0 +1,53 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
################################################################################### |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
||||
|
# Author: Nilmar Shereef(<https://www.cybrosys.com>) |
||||
|
# |
||||
|
# 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 <https://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
################################################################################### |
||||
|
from odoo import models, fields, api, _ |
||||
|
|
||||
|
|
||||
|
class ProjectReportButton(models.TransientModel): |
||||
|
_name = 'wizard.project.report' |
||||
|
|
||||
|
task_select = fields.Boolean(string="Task", default=True) |
||||
|
issue_select = fields.Boolean(string="Issue", default=True) |
||||
|
partner_select = fields.Many2many('res.users', string='Assigned to') |
||||
|
stage_select = fields.Many2many('project.task.type', string="Stage") |
||||
|
|
||||
|
@api.multi |
||||
|
def print_project_report_pdf(self): |
||||
|
|
||||
|
active_record = self._context['active_id'] |
||||
|
record = self.env['project.project'].browse(active_record) |
||||
|
return self.env['report'].get_action(record, "project_report_pdf.project_report_template") |
||||
|
|
||||
|
@api.multi |
||||
|
def print_project_report_xls(self): |
||||
|
context = self._context |
||||
|
datas = {'ids': context.get('active_ids', [])} |
||||
|
datas['model'] = 'project.project' |
||||
|
datas['form'] = self.read()[0] |
||||
|
for field in datas['form'].keys(): |
||||
|
if isinstance(datas['form'][field], tuple): |
||||
|
datas['form'][field] = datas['form'][field][0] |
||||
|
return {'type': 'ir.actions.report.xml', |
||||
|
'report_name': 'project_report_pdf.project_report_xls.xlsx', |
||||
|
'datas': datas, |
||||
|
'name': 'Project Report' |
||||
|
} |
@ -0,0 +1,170 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
################################################################################### |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
||||
|
# Author: Nilmar Shereef(<https://www.cybrosys.com>) |
||||
|
# |
||||
|
# 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 <https://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
################################################################################### |
||||
|
|
||||
|
from odoo.http import request |
||||
|
from odoo import models, api |
||||
|
|
||||
|
|
||||
|
class ProjectReportParser(models.AbstractModel): |
||||
|
_name = 'report.project_report_pdf.project_report_template' |
||||
|
|
||||
|
def get_task_model(self, name): |
||||
|
wizard_record = request.env['wizard.project.report'].search([])[-1] |
||||
|
task_obj = request.env['project.task'] |
||||
|
users_selected = [] |
||||
|
stages_selected = [] |
||||
|
current_task_obj = [] |
||||
|
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 len(wizard_record.partner_select) == 0: |
||||
|
if len(wizard_record.stage_select) == 0: |
||||
|
current_task = task_obj.search([('project_id', '=', name)]) |
||||
|
for i in current_task: |
||||
|
vals = { |
||||
|
'name': i.name, |
||||
|
'user_id': i.user_id.name, |
||||
|
'stage_id': i.stage_id.name, |
||||
|
} |
||||
|
current_task_obj.append(vals) |
||||
|
return current_task_obj |
||||
|
else: |
||||
|
current_task = task_obj.search([('project_id', '=', name), ('stage_id', 'in', stages_selected)]) |
||||
|
for i in current_task: |
||||
|
vals = { |
||||
|
'name': i.name, |
||||
|
'user_id': i.user_id.name, |
||||
|
'stage_id': i.stage_id.name, |
||||
|
} |
||||
|
current_task_obj.append(vals) |
||||
|
return current_task_obj |
||||
|
else: |
||||
|
if len(wizard_record.stage_select) == 0: |
||||
|
current_task = task_obj.search([('project_id', '=', name), ('user_id', 'in', users_selected)]) |
||||
|
for i in current_task: |
||||
|
vals = { |
||||
|
'name': i.name, |
||||
|
'user_id': i.user_id.name, |
||||
|
'stage_id': i.stage_id.name, |
||||
|
} |
||||
|
current_task_obj.append(vals) |
||||
|
return current_task_obj |
||||
|
else: |
||||
|
current_task = task_obj.search( |
||||
|
[('project_id', '=', name), ('user_id', 'in', users_selected), ('stage_id', 'in', stages_selected)]) |
||||
|
for i in current_task: |
||||
|
vals = { |
||||
|
'name': i.name, |
||||
|
'user_id': i.user_id.name, |
||||
|
'stage_id': i.stage_id.name, |
||||
|
} |
||||
|
current_task_obj.append(vals) |
||||
|
return current_task_obj |
||||
|
|
||||
|
def get_issue_model(self, name): |
||||
|
wizard_record = request.env['wizard.project.report'].search([])[-1] |
||||
|
issue_obj = request.env['project.issue'] |
||||
|
task_obj = issue_obj |
||||
|
users_selected = [] |
||||
|
stages_selected = [] |
||||
|
current_task_obj = [] |
||||
|
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 len(wizard_record.partner_select) == 0: |
||||
|
if len(wizard_record.stage_select) == 0: |
||||
|
current_task = task_obj.search([('project_id', '=', name)]) |
||||
|
for i in current_task: |
||||
|
vals = { |
||||
|
'name': i.name, |
||||
|
'user_id': i.user_id.name, |
||||
|
'stage_id': i.stage_id.name, |
||||
|
} |
||||
|
current_task_obj.append(vals) |
||||
|
return current_task_obj |
||||
|
else: |
||||
|
current_task = task_obj.search([('project_id', '=', name), ('stage_id', 'in', stages_selected)]) |
||||
|
for i in current_task: |
||||
|
vals = { |
||||
|
'name': i.name, |
||||
|
'user_id': i.user_id.name, |
||||
|
'stage_id': i.stage_id.name, |
||||
|
} |
||||
|
current_task_obj.append(vals) |
||||
|
return current_task_obj |
||||
|
else: |
||||
|
if len(wizard_record.stage_select) == 0: |
||||
|
current_task = task_obj.search([('project_id', '=', name), ('user_id', 'in', users_selected)]) |
||||
|
for i in current_task: |
||||
|
vals = { |
||||
|
'name': i.name, |
||||
|
'user_id': i.user_id.name, |
||||
|
'stage_id': i.stage_id.name, |
||||
|
} |
||||
|
current_task_obj.append(vals) |
||||
|
return current_task_obj |
||||
|
else: |
||||
|
current_task = task_obj.search( |
||||
|
[('project_id', '=', name), ('user_id', 'in', users_selected), ('stage_id', 'in', stages_selected)]) |
||||
|
for i in current_task: |
||||
|
vals = { |
||||
|
'name': i.name, |
||||
|
'user_id': i.user_id.name, |
||||
|
'stage_id': i.stage_id.name, |
||||
|
} |
||||
|
current_task_obj.append(vals) |
||||
|
return current_task_obj |
||||
|
|
||||
|
def get_list_model_task(self, name): |
||||
|
wizard_record = request.env['wizard.project.report'].search([])[-1] |
||||
|
if wizard_record.task_select: |
||||
|
return 2 |
||||
|
else: |
||||
|
return 3 |
||||
|
|
||||
|
def get_list_model_issue(self, name): |
||||
|
wizard_record = request.env['wizard.project.report'].search([])[-1] |
||||
|
if wizard_record.issue_select: |
||||
|
return 2 |
||||
|
else: |
||||
|
return 3 |
||||
|
|
||||
|
@api.model |
||||
|
def render_html(self, docids, data=None): |
||||
|
self.model = self.env.context.get('active_model') |
||||
|
model = self.env['project.project'].search([('id', '=', docids)]) |
||||
|
get_task_model = self.get_task_model(docids), |
||||
|
get_issue_model = self.get_issue_model(docids), |
||||
|
get_list_model_task = self.get_list_model_task(docids), |
||||
|
get_list_model_issue = self.get_list_model_issue(docids), |
||||
|
docargs = { |
||||
|
'doc': model, |
||||
|
'get_task_model': get_task_model, |
||||
|
'get_issue_model': get_issue_model, |
||||
|
'get_list_model_task': get_list_model_task[0], |
||||
|
'get_list_model_issue': get_list_model_issue[0], |
||||
|
} |
||||
|
|
||||
|
return self.env['report'].render('project_report_pdf.project_report_template', docargs) |
||||
|
|
@ -0,0 +1,22 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
################################################################################### |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
||||
|
# Author: Nilmar Shereef(<https://www.cybrosys.com>) |
||||
|
# |
||||
|
# 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 <https://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
################################################################################### |
||||
|
import project_report_xls |
@ -0,0 +1,144 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
################################################################################### |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
||||
|
# Author: Nilmar Shereef(<https://www.cybrosys.com>) |
||||
|
# |
||||
|
# 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 <https://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
################################################################################### |
||||
|
from odoo.addons.report_xlsx.report.report_xlsx import ReportXlsx |
||||
|
|
||||
|
|
||||
|
class ProjectReportXls(ReportXlsx): |
||||
|
|
||||
|
def generate_xlsx_report(self, workbook, data, lines): |
||||
|
|
||||
|
sheet = workbook.add_worksheet("Project Report") |
||||
|
format1 = workbook.add_format({'font_size': 22, 'bg_color': '#D3D3D3'}) |
||||
|
format4 = workbook.add_format({'font_size': 22}) |
||||
|
format2 = workbook.add_format({'font_size': 12, 'bold': True, 'bg_color': '#D3D3D3'}) |
||||
|
format3 = workbook.add_format({'font_size': 10}) |
||||
|
format5 = workbook.add_format({'font_size': 10, 'bg_color': '#FFFFFF'}) |
||||
|
format7 = workbook.add_format({'font_size': 10, 'bg_color': '#FFFFFF'}) |
||||
|
format6 = workbook.add_format({'font_size': 22, 'bg_color': '#FFFFFF'}) |
||||
|
format7.set_align('center') |
||||
|
sheet.merge_range('A1:B1', lines.company_id.name, format5) |
||||
|
sheet.merge_range('A2:B2', lines.company_id.street, format5) |
||||
|
sheet.write('A3', lines.company_id.city, format5) |
||||
|
sheet.write('B3', lines.company_id.zip, format5) |
||||
|
sheet.merge_range('A4:B4', lines.company_id.state_id.name, format5) |
||||
|
sheet.merge_range('A5:B5', lines.company_id.country_id.name, format5) |
||||
|
sheet.merge_range('G1:H1', lines.company_id.rml_header1, format5) |
||||
|
sheet.merge_range(5, 0, 6, 1, "Project :", format1) |
||||
|
sheet.merge_range(5, 2, 6, 7, lines.name, format1) |
||||
|
sheet.merge_range('A8:B8', "Project Manager :", format5) |
||||
|
sheet.merge_range('C8:D8', lines.user_id.name, format5) |
||||
|
if lines.date_start: |
||||
|
date_start = lines.date_start |
||||
|
else: |
||||
|
date_start = "" |
||||
|
if lines.date: |
||||
|
date_end = lines.date |
||||
|
else: |
||||
|
date_end = "" |
||||
|
sheet.merge_range('A9:B9', "Start Date :", format5) |
||||
|
sheet.merge_range('C9:D9', date_start, format5) |
||||
|
sheet.merge_range('A10:B10', "End Date :", format5) |
||||
|
sheet.merge_range('C10:D10', date_end, format5) |
||||
|
row_number = 10 |
||||
|
|
||||
|
sheet.merge_range(0, 2, 4, 5, "", format5) |
||||
|
sheet.merge_range(1, 6, 4, 7, "", format5) |
||||
|
sheet.merge_range(7, 4, 9, 7, "", format5) |
||||
|
|
||||
|
if data['form']['task_select'] == True : |
||||
|
|
||||
|
sheet.merge_range(10, 4, 11, 7, "", format5) |
||||
|
sheet.merge_range(row_number, 0, row_number+1, 3, "Open Tasks", format4) |
||||
|
row_number += 2 |
||||
|
task_obj = self.env['project.task'] |
||||
|
if len(data['form']['partner_select']) == 0: |
||||
|
if len(data['form']['stage_select']) == 0: |
||||
|
current_task_obj = task_obj.search([('project_id', '=', lines.id)]) |
||||
|
else: |
||||
|
current_task_obj = task_obj.search( |
||||
|
[('project_id', '=', lines.id), ('stage_id', 'in', data['form']['stage_select'])]) |
||||
|
else: |
||||
|
if len(data['form']['stage_select']) == 0: |
||||
|
current_task_obj = task_obj.search( |
||||
|
[('project_id', '=', lines.id), ('user_id', 'in', data['form']['partner_select'])]) |
||||
|
else: |
||||
|
current_task_obj = task_obj.search( |
||||
|
[('project_id', '=', lines.id), ('user_id', 'in', data['form']['partner_select']), |
||||
|
('stage_id', 'in', data['form']['stage_select'])]) |
||||
|
|
||||
|
sheet.merge_range(row_number, 0, row_number, 3, "Tasks", format2) |
||||
|
sheet.merge_range(row_number, 4, row_number, 5, "Assigned", format2) |
||||
|
sheet.merge_range(row_number, 6, row_number, 7, "Stage", format2) |
||||
|
for records in current_task_obj: |
||||
|
row_number += 1 |
||||
|
if records.user_id.name: |
||||
|
user_name = records.user_id.name |
||||
|
else: |
||||
|
user_name = "" |
||||
|
sheet.merge_range(row_number, 0, row_number, 3, records.name, format3) |
||||
|
sheet.merge_range(row_number, 4, row_number, 5, user_name, format3) |
||||
|
sheet.merge_range(row_number, 6, row_number, 7, records.stage_id.name, format3) |
||||
|
row_number += 1 |
||||
|
if data['form']['issue_select'] == True : |
||||
|
|
||||
|
row_number += 1 |
||||
|
sheet.merge_range(row_number-1, 0, row_number-1, 7, "", format4) |
||||
|
sheet.merge_range(row_number, 4, row_number + 1, 7, "", format5) |
||||
|
sheet.merge_range(row_number, 0, row_number+1, 3, "Open Issues", format6) |
||||
|
row_number += 2 |
||||
|
task_obj = self.env['project.issue'] |
||||
|
|
||||
|
|
||||
|
if len(data['form']['partner_select']) == 0: |
||||
|
if len(data['form']['stage_select']) == 0: |
||||
|
current_task_obj = task_obj.search([('project_id', '=', lines.id)]) |
||||
|
else: |
||||
|
current_task_obj = task_obj.search( |
||||
|
[('project_id', '=', lines.id), ('stage_id', 'in', data['form']['stage_select'])]) |
||||
|
else: |
||||
|
if len(data['form']['stage_select']) == 0: |
||||
|
current_task_obj = task_obj.search( |
||||
|
[('project_id', '=', lines.id), ('user_id', 'in', data['form']['partner_select'])]) |
||||
|
else: |
||||
|
current_task_obj = task_obj.search( |
||||
|
[('project_id', '=', lines.id), ('user_id', 'in', data['form']['partner_select']), |
||||
|
('stage_id', 'in', data['form']['stage_select'])]) |
||||
|
|
||||
|
sheet.merge_range(row_number, 0, row_number, 3, "Issues", format2) |
||||
|
sheet.merge_range(row_number, 4, row_number, 5, "Assigned", format2) |
||||
|
sheet.merge_range(row_number, 6, row_number, 7, "Stage", format2) |
||||
|
for records in current_task_obj: |
||||
|
row_number += 1 |
||||
|
if records.user_id.name: |
||||
|
user_name = records.user_id.name |
||||
|
else: |
||||
|
user_name = "" |
||||
|
sheet.merge_range(row_number, 0, row_number, 3, records.name, format3) |
||||
|
sheet.merge_range(row_number, 4, row_number, 5, user_name, format3) |
||||
|
sheet.merge_range(row_number, 6, row_number, 7, records.stage_id.name, format3) |
||||
|
row_number += 2 |
||||
|
sheet.merge_range(row_number, 0, row_number, 1, lines.company_id.phone, format7) |
||||
|
sheet.merge_range(row_number, 2, row_number, 4, lines.company_id.email, format7) |
||||
|
sheet.merge_range(row_number, 5, row_number, 7, lines.company_id.website, format7) |
||||
|
|
||||
|
|
||||
|
ProjectReportXls('report.project_report_pdf.project_report_xls.xlsx', 'project.project') |
After Width: | Height: | Size: 70 KiB |
After Width: | Height: | Size: 50 KiB |
After Width: | Height: | Size: 16 KiB |
@ -0,0 +1,129 @@ |
|||||
|
<section class="oe_container"> |
||||
|
<div class="oe_row oe_spaced"> |
||||
|
<h2 class="oe_slogan">Project Report PDF & XLS</h2> |
||||
|
<h3 class="oe_slogan">This Module Gives You The PDF and XLS Report of |
||||
|
Project.</h3> |
||||
|
<h4 class="oe_slogan">Cybrosys Technologies , www.cybrosys.com</h4> |
||||
|
</div> |
||||
|
<div class="oe_row oe_spaced"> |
||||
|
<div> |
||||
|
This report prints the Tasks and Issues Related to the Project. |
||||
|
You can filter the report based on Tasks or Issues, Assigned User |
||||
|
and Stage of the Task/Issue |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="oe_row oe_spaced"> |
||||
|
<div> |
||||
|
☛ Installation : You need report_xlsx module to run this properly. More details see the README.rst file of this module. |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="oe_row oe_spaced"> |
||||
|
<div class="oe_span12"> |
||||
|
<p class='oe_mt32'> |
||||
|
Go to Project -> Project. |
||||
|
<p class='oe_mt32'> |
||||
|
And then Select One Project.Then you can see a print button. |
||||
|
Click that button. |
||||
|
</p> |
||||
|
</div> |
||||
|
<div class="oe_span10"> |
||||
|
<div class="oe_demo oe_picture oe_screenshot"> |
||||
|
<img src="screen_shot_modules_location.png"> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</section> |
||||
|
|
||||
|
<section class="oe_container oe_dark"> |
||||
|
<div class="oe_row oe_padded"> |
||||
|
<div class="oe_span12"> |
||||
|
<p> |
||||
|
Then a wizard will open. You can filter the project report |
||||
|
by selecting the Appropriate options from the wizard. |
||||
|
if you don't select "Assigned to" & "Stage" in the wizard, |
||||
|
then system automatically select all the users and stages. |
||||
|
</p> |
||||
|
</div> |
||||
|
<div class="oe_span12"> |
||||
|
<div class="oe_row_img oe_centered"> |
||||
|
<img class="oe_picture oe_screenshot" |
||||
|
src="screen_shot_wizard.png"> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</section> |
||||
|
<section class="oe_container oe_dark"> |
||||
|
<div class="oe_row oe_padded"> |
||||
|
<div class="oe_span6"> |
||||
|
<div class="oe_row_img oe_centered"> |
||||
|
<img class="oe_picture oe_screenshot" |
||||
|
src="screen_shot_pdf_report.png"> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="oe_span6"> |
||||
|
<p> |
||||
|
* PDF Report Of Data Import/Export Plugin Project.(Both Tasks and Issues) |
||||
|
</p> |
||||
|
</div> |
||||
|
</div> |
||||
|
</section> |
||||
|
<section class="oe_container oe_dark"> |
||||
|
<div class="oe_row oe_padded"> |
||||
|
<div class="oe_span6"> |
||||
|
<p> |
||||
|
* PDF Report Of Data Import/Export Plugin Project.(Issues Only) |
||||
|
</p> |
||||
|
</div> |
||||
|
<div class="oe_span6"> |
||||
|
<div class="oe_row_img oe_centered"> |
||||
|
<img class="oe_picture oe_screenshot" |
||||
|
src="screen_shot_pdf_report_2.png"> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</section> |
||||
|
<section class="oe_container oe_dark"> |
||||
|
<div class="oe_row oe_padded"> |
||||
|
<div class="oe_span6"> |
||||
|
<div class="oe_row_img oe_centered"> |
||||
|
<img class="oe_picture oe_screenshot" |
||||
|
src="screen_shot_xls_report.png"> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="oe_span6"> |
||||
|
<p> |
||||
|
* XLS Report Of Data Import/Export Plugin Project.(Both Tasks and Issues) |
||||
|
</p> |
||||
|
</div> |
||||
|
</div> |
||||
|
</section> |
||||
|
<section class="oe_container oe_dark"> |
||||
|
<div class="oe_row oe_padded"> |
||||
|
<div class="oe_span6"> |
||||
|
<p> |
||||
|
* XLS Report Of Data Import/Export Plugin Project.(Issues Only) |
||||
|
</p> |
||||
|
</div> |
||||
|
<div class="oe_span6"> |
||||
|
<div class="oe_row_img oe_centered"> |
||||
|
<img class="oe_picture oe_screenshot" |
||||
|
src="screen_shot_xls_report_2.png"> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</section> |
||||
|
<section class="oe_container oe_dark"> |
||||
|
<h2 class="oe_slogan" style="margin-top:20px;" >Need Any Help?</h2> |
||||
|
<div class="oe_slogan" style="margin-top:10px !important;"> |
||||
|
<a class="btn btn-primary btn-lg mt8" |
||||
|
style="color: #FFFFFF !important;" href="https://www.cybrosys.com"><i |
||||
|
class="fa fa-envelope"></i> Email </a> <a |
||||
|
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;" |
||||
|
href="https://www.cybrosys.com/contact/"><i |
||||
|
class="fa fa-phone"></i> Contact Us </a> <a |
||||
|
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;" |
||||
|
href="https://www.cybrosys.com/odoo-customization-and-installation/"><i |
||||
|
class="fa fa-check-square"></i> Request Customization </a> |
||||
|
</div> |
||||
|
<img src="cybro_logo.png" style="width: 190px; margin-bottom: 20px;" class="center-block"> |
||||
|
</section> |
After Width: | Height: | Size: 67 KiB |
After Width: | Height: | Size: 49 KiB |
After Width: | Height: | Size: 35 KiB |
After Width: | Height: | Size: 51 KiB |
After Width: | Height: | Size: 49 KiB |
After Width: | Height: | Size: 32 KiB |
@ -0,0 +1,22 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<odoo> |
||||
|
<data> |
||||
|
<report |
||||
|
id="report_project_pdf" |
||||
|
string="Project Report" |
||||
|
model="project.project" |
||||
|
report_type="qweb-pdf" |
||||
|
file="project_report_pdf.project_report_template" |
||||
|
name="project_report_pdf.project_report_template" |
||||
|
/> |
||||
|
<report |
||||
|
id="project_xlsx" |
||||
|
model="project.project" |
||||
|
string=" " |
||||
|
report_type="xlsx" |
||||
|
name="project_report_pdf.project_report_xls.xlsx" |
||||
|
file="project_report_pdf.project_report_xls.xlsx" |
||||
|
attachment_use="False" |
||||
|
/> |
||||
|
</data> |
||||
|
</odoo> |
@ -0,0 +1,16 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8" ?> |
||||
|
<odoo> |
||||
|
<data> |
||||
|
<record id="project_report_pdf_inherited" model="ir.ui.view"> |
||||
|
<field name="name">project_report_pdf_inherited.form</field> |
||||
|
<field name="model">project.project</field> |
||||
|
<field name="inherit_id" ref="project.edit_project"/> |
||||
|
<field name="arch" type="xml"> |
||||
|
<xpath expr="//sheet" position='before'> |
||||
|
<header> |
||||
|
<button name="%(project_report_pdf.project_report_open_wizard)d" type="action" string="Print" class="oe_highlight"/> |
||||
|
</header></xpath> |
||||
|
</field> |
||||
|
</record> |
||||
|
</data> |
||||
|
</odoo> |
@ -0,0 +1,76 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<odoo> |
||||
|
<template id="project_report_template"> |
||||
|
<t t-call="report.html_container"> |
||||
|
<t t-set="doc" t-value="doc.with_context({'lang':doc.partner_id.lang})" /> |
||||
|
<t t-set="doc2" t-value="get_task_model"/> |
||||
|
<t t-set="doc3" t-value="get_issue_model"/> |
||||
|
<t t-set="doc4" t-value="get_list_model_task"/> |
||||
|
<t t-set="doc5" t-value="get_list_model_issue"/> |
||||
|
<t t-call="report.external_layout"> |
||||
|
<div class="page" > |
||||
|
<br/> |
||||
|
|
||||
|
<div style="text-align:left;color:black!important;"><strong><h1>Project :<span t-field="doc.name"/></h1></strong></div> |
||||
|
<div style="text-align:left;color:black!important;"><strong><p>Project Manager:<span t-field="doc.user_id"/></p></strong></div> |
||||
|
<div style="text-align:left;color:black!important;"><strong><p>Start Date:<span t-field="doc.date_start"/></p></strong></div> |
||||
|
<div style="text-align:left;color:black!important;"><strong><p>End Date:<span t-field="doc.date"/></p></strong></div> |
||||
|
<div t-if="doc4 == 2" style="text-align:left;color:black!important;"><strong><h1>Open Tasks</h1></strong></div> |
||||
|
<table t-if="doc4 == 2" class="table table-condensed"> |
||||
|
<thead> |
||||
|
<tr > |
||||
|
<th style="background-color:#9b9da0 !important;">Task</th> |
||||
|
<th style="background-color:#9b9da0 !important;">Assigned</th> |
||||
|
<th style="background-color:#9b9da0 !important;">Stage</th> |
||||
|
</tr> |
||||
|
</thead> |
||||
|
<tbody> |
||||
|
<t t-foreach="doc2" t-as="b"> |
||||
|
<t t-foreach="b" t-as="l"> |
||||
|
<tr> |
||||
|
<td> |
||||
|
<span t-att-style="style" t-esc="l['name']"/> |
||||
|
</td> |
||||
|
<td> |
||||
|
<span t-att-style="style" t-esc="l['user_id']"/> |
||||
|
</td> |
||||
|
<td> |
||||
|
<span t-att-style="style" t-esc="l['stage_id']"/> |
||||
|
</td> |
||||
|
</tr> |
||||
|
</t></t> |
||||
|
</tbody> |
||||
|
</table> |
||||
|
|
||||
|
<div t-if="doc5 == 2" style="text-align:left;"><strong><h1>Open Issues</h1></strong></div> |
||||
|
<table t-if="doc5 == 2" class="table table-condensed"> |
||||
|
<thead> |
||||
|
<tr > |
||||
|
<th style="background-color:#9b9da0 !important;">Issue</th> |
||||
|
<th style="background-color:#9b9da0 !important;">Assigned</th> |
||||
|
<th style="background-color:#9b9da0 !important;">Stage</th> |
||||
|
</tr> |
||||
|
</thead> |
||||
|
<tbody> |
||||
|
<t t-foreach="doc3" t-as="b1"> |
||||
|
<t t-foreach="b1" t-as="k"> |
||||
|
<tr> |
||||
|
<td> |
||||
|
<span t-att-style="style" t-esc="k['name']"/> |
||||
|
</td> |
||||
|
<td> |
||||
|
<span t-att-style="style" t-esc="k['user_id']"/> |
||||
|
</td> |
||||
|
<td> |
||||
|
<span t-att-style="style" t-esc="k['stage_id']"/> |
||||
|
</td> |
||||
|
</tr> |
||||
|
</t></t> |
||||
|
</tbody> |
||||
|
</table> |
||||
|
|
||||
|
</div> |
||||
|
</t> |
||||
|
</t> |
||||
|
</template> |
||||
|
</odoo> |
@ -0,0 +1,39 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
<odoo> |
||||
|
<data> |
||||
|
<record id="report_wizard_view_form" model="ir.ui.view"> |
||||
|
<field name="name">report_wizard_view_form.form</field> |
||||
|
<field name="model">wizard.project.report</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
<form string="Select period"> |
||||
|
|
||||
|
<group> |
||||
|
<group> |
||||
|
<field name="task_select"/> |
||||
|
<field name="issue_select"/> |
||||
|
</group> |
||||
|
<group > |
||||
|
<field name="partner_select" widget="many2many_tags"/> |
||||
|
<field name="stage_select" widget="many2many_tags"/> |
||||
|
</group> |
||||
|
</group> |
||||
|
|
||||
|
<footer> |
||||
|
<button name="print_project_report_pdf" type="object" string="Print PDF" class="oe_highlight"/> |
||||
|
or |
||||
|
<button name="print_project_report_xls" type="object" string="Print XLS" class="oe_highlight"/> |
||||
|
or |
||||
|
<button special="cancel" string="Cancel"/> |
||||
|
</footer> |
||||
|
</form> |
||||
|
</field> |
||||
|
</record> |
||||
|
<act_window |
||||
|
id="project_report_open_wizard" |
||||
|
name="Project Report" |
||||
|
res_model="wizard.project.report" |
||||
|
view_mode="form" |
||||
|
view_id="report_wizard_view_form" |
||||
|
target="new"/> |
||||
|
</data> |
||||
|
</odoo> |