Browse Source

A report addon for project app

pull/9/merge
SHEREEF PT 8 years ago
parent
commit
2f0e5ae749
  1. 25
      project_report_pdf/README.rst
  2. 24
      project_report_pdf/__init__.py
  3. 41
      project_report_pdf/__openerp__.py
  4. 24
      project_report_pdf/models/__init__.py
  5. 53
      project_report_pdf/models/project_report.py
  6. 114
      project_report_pdf/models/project_report_parser.py
  7. 23
      project_report_pdf/report/__init__.py
  8. 152
      project_report_pdf/report/project_report_xls.py
  9. BIN
      project_report_pdf/static/description/banner.jpg
  10. BIN
      project_report_pdf/static/description/cybro_logo.png
  11. BIN
      project_report_pdf/static/description/icon.png
  12. 129
      project_report_pdf/static/description/index.html
  13. BIN
      project_report_pdf/static/description/screen_shot_modules_location.png
  14. BIN
      project_report_pdf/static/description/screen_shot_pdf_report.png
  15. BIN
      project_report_pdf/static/description/screen_shot_pdf_report_2.png
  16. BIN
      project_report_pdf/static/description/screen_shot_wizard.png
  17. BIN
      project_report_pdf/static/description/screen_shot_xls_report.png
  18. BIN
      project_report_pdf/static/description/screen_shot_xls_report_2.png
  19. 20
      project_report_pdf/views/project_report.xml
  20. 15
      project_report_pdf/views/project_report_button.xml
  21. 82
      project_report_pdf/views/project_report_pdf_view.xml
  22. 39
      project_report_pdf/views/wizard_report.xml

25
project_report_pdf/README.rst

@ -0,0 +1,25 @@
Project Report
==============
PDF and XLS Reports for Project Module v8.
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/8.0/report_xlsx
Credits
=======
Cybrosys Techno Solutions <www.cybrosys.com>
Author
------
* Developer: Avinash Nk @ cybrosys
* Guidance: Nilmar Shereef @ cybrosys, shereef@cybrosys.in

24
project_report_pdf/__init__.py

@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2009-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Nilmar Shereef(<http://www.cybrosys.com>)
# you can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
#
# It is forbidden to publish, distribute, sublicense, or sell copies
# of the Software or modified copies of the Software.
#
# 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
# GENERAL PUBLIC LICENSE (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import models
import report

41
project_report_pdf/__openerp__.py

@ -0,0 +1,41 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2009-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Nilmar Shereef(<http://www.cybrosys.com>)
# you can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
#
# It is forbidden to publish, distribute, sublicense, or sell copies
# of the Software or modified copies of the Software.
#
# 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
# GENERAL PUBLIC LICENSE (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
{
'name': 'Project Report XLS & PDF',
'version': '0.2',
"category": "Project",
'author': 'Cybrosys Techno Solutions',
'website': "http://www.cybrosys.com",
'company': 'Cybrosys Techno Solutions',
'summary': """This Module gives PDF & XLS Reports for Project With Advanced Filtrations""",
'depends': ['base', 'project', 'project_issue', 'report_xlsx'],
'data': ['views/wizard_report.xml',
'views/project_report_pdf_view.xml',
'views/project_report_button.xml',
'views/project_report.xml'
],
'license': 'AGPL-3',
'images': ['static/description/banner.jpg'],
'installable': True,
'auto_install': False,
}

24
project_report_pdf/models/__init__.py

@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2009-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Nilmar Shereef(<http://www.cybrosys.com>)
# you can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
#
# It is forbidden to publish, distribute, sublicense, or sell copies
# of the Software or modified copies of the Software.
#
# 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
# GENERAL PUBLIC LICENSE (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import project_report
import project_report_parser

53
project_report_pdf/models/project_report.py

@ -0,0 +1,53 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2009-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Nilmar Shereef(<http://www.cybrosys.com>)
# you can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
#
# It is forbidden to publish, distribute, sublicense, or sell copies
# of the Software or modified copies of the Software.
#
# 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
# GENERAL PUBLIC LICENSE (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from openerp 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_transition")
@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'
}

114
project_report_pdf/models/project_report_parser.py

@ -0,0 +1,114 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2009-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Nilmar Shereef(<http://www.cybrosys.com>)
# you can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
#
# It is forbidden to publish, distribute, sublicense, or sell copies
# of the Software or modified copies of the Software.
#
# 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
# GENERAL PUBLIC LICENSE (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from openerp.report import report_sxw
from openerp.osv import osv
from openerp.http import request
class ProjectReportParser(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context=None):
super(ProjectReportParser, self).__init__(cr, uid, name, context=context)
self.localcontext.update({
'get_task_model': self.get_task_model,
'get_issue_model': self.get_issue_model,
'get_list_model_task': self.get_list_model_task,
'get_list_model_issue': self.get_list_model_issue,
})
self.context = context
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 = []
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_obj = task_obj.search([('project_id', '=', name)])
return current_task_obj
else:
current_task_obj = task_obj.search([('project_id', '=', name), ('stage_id', 'in', stages_selected)])
return current_task_obj
else:
if len(wizard_record.stage_select) == 0:
current_task_obj = task_obj.search([('project_id', '=', name), ('user_id', 'in', users_selected)])
return current_task_obj
else:
current_task_obj = task_obj.search(
[('project_id', '=', name), ('user_id', 'in', users_selected), ('stage_id', 'in', stages_selected)])
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 = []
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_obj = task_obj.search([('project_id', '=', name)])
return current_task_obj
else:
current_task_obj = task_obj.search([('project_id', '=', name), ('stage_id', 'in', stages_selected)])
return current_task_obj
else:
if len(wizard_record.stage_select) == 0:
current_task_obj = task_obj.search([('project_id', '=', name), ('user_id', 'in', users_selected)])
return current_task_obj
else:
current_task_obj = task_obj.search(
[('project_id', '=', name), ('user_id', 'in', users_selected), ('stage_id', 'in', stages_selected)])
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 == True:
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 == True:
return 2
else:
return 3
class PrintReportProject(osv.AbstractModel):
_name = 'report.project_report_pdf.project_report_transition'
_inherit = 'report.abstract_report'
_template = 'project_report_pdf.project_report_transition'
_wrapped_report_class = ProjectReportParser

23
project_report_pdf/report/__init__.py

@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2009-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Nilmar Shereef(<http://www.cybrosys.com>)
# you can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
#
# It is forbidden to publish, distribute, sublicense, or sell copies
# of the Software or modified copies of the Software.
#
# 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
# GENERAL PUBLIC LICENSE (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import project_report_xls

152
project_report_pdf/report/project_report_xls.py

@ -0,0 +1,152 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2009-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Nilmar Shereef(<http://www.cybrosys.com>)
# you can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
#
# It is forbidden to publish, distribute, sublicense, or sell copies
# of the Software or modified copies of the Software.
#
# 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
# GENERAL PUBLIC LICENSE (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from openerp.addons.report_xlsx.report.report_xlsx import ReportXlsx
class ProjectReportXls(ReportXlsx):
def generate_xlsx_report(self, workbook, data, lines):
sheet = workbook.add_worksheet()
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')
if lines.company_id.state_id.name == False:
state_name = ""
else:
state_name = lines.company_id.state_id.name
if lines.company_id.country_id.name == False:
country_name = ""
else:
country_name = lines.company_id.country_id.name
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', state_name, format5)
sheet.merge_range('A5:B5', country_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')

BIN
project_report_pdf/static/description/banner.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 KiB

BIN
project_report_pdf/static/description/cybro_logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

BIN
project_report_pdf/static/description/icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

129
project_report_pdf/static/description/index.html

@ -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>
&#x261B; 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="http://www.cybrosys.com"><i
class="fa fa-envelope"></i> Email </a> <a
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;"
href="http://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="http://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>

BIN
project_report_pdf/static/description/screen_shot_modules_location.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

BIN
project_report_pdf/static/description/screen_shot_pdf_report.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

BIN
project_report_pdf/static/description/screen_shot_pdf_report_2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

BIN
project_report_pdf/static/description/screen_shot_wizard.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

BIN
project_report_pdf/static/description/screen_shot_xls_report.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

BIN
project_report_pdf/static/description/screen_shot_xls_report_2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

20
project_report_pdf/views/project_report.xml

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<report
id="report_project_pdf"
model="project.project"
string="Project Report"
report_type="qweb-pdf"
name="project_report_pdf.project_report_transition"/>
<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>
</openerp>

15
project_report_pdf/views/project_report_button.xml

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8" ?>
<openerp>
<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='//field[@name="state"]' position='before'>
<button name="%(project_report_pdf.project_report_open_wizard)d" type="action" string="Print" class="oe_highlight"/>
</xpath>
</field>
</record>
</data>
</openerp>

82
project_report_pdf/views/project_report_pdf_view.xml

@ -0,0 +1,82 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<template id="project_report_template">
<t t-call="report.html_container">
<t t-foreach="docs" t-as="doc">
<t t-set="doc" t-value="doc.with_context({'lang':doc.partner_id.lang})" />
<t t-set="doc2" t-value="get_task_model(doc.id)"/>
<t t-set="doc3" t-value="get_issue_model(doc.id)"/>
<t t-set="doc4" t-value="get_list_model_task(doc.id)"/>
<t t-set="doc5" t-value="get_list_model_issue(doc.id)"/>
<div class="page" >
<t t-call="report.external_layout">
<div class="header" style="text-align:left;"><strong><h1><a>Project :</a><a t-field="doc.name"/></h1></strong></div>
<div style="text-align:left;"><strong><p><a>Project Manager:</a><a t-field="doc.user_id"/></p></strong></div>
<div style="text-align:left;"><strong><p><a>Start Date:</a><a t-field="doc.date_start"/></p></strong></div>
<div style="text-align:left;"><strong><p><a>End Date:</a><a t-field="doc.date"/></p></strong></div>
<div t-if="doc4 == 2" class="header" style="text-align:left;"><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">
<tr>
<td>
<span t-att-style="style" t-esc="b.name"/>
</td>
<td>
<span t-att-style="style" t-esc="b.user_id.name"/>
</td>
<td>
<span t-att-style="style" t-esc="b.stage_id.name"/>
</td>
</tr>
</t>
</tbody>
</table>
<div t-if="doc5 == 2" class="header" 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">
<tr>
<td>
<span t-att-style="style" t-esc="b1.name"/>
</td>
<td>
<span t-att-style="style" t-esc="b1.user_id.name"/>
</td>
<td>
<span t-att-style="style" t-esc="b1.stage_id.name"/>
</td>
</tr>
</t>
</tbody>
</table>
</t>
</div>
</t>
</t>
</template>
<template id="project_report_transition">
<t t-call="report.html_container">
<t t-foreach="doc_ids" t-as="doc_id">
<t t-raw="translate_doc(doc_id, doc_model, 'partner_id.lang', 'project_report_pdf.project_report_template')"/>
</t>
</t>
</template>
</data>
</openerp>

39
project_report_pdf/views/wizard_report.xml

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8" ?>
<openerp>
<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>
<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>
</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>
</openerp>
Loading…
Cancel
Save