# -*- 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 odoo import models, fields, api, _ class ProjectReportButton(models.TransientModel): _name = 'wizard.project.report' 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) data = { 'ids': self.ids, 'model': self._name, 'record': record.id, } return self.env.ref('project_report_pdf.report_project_pdf').report_action(self, data=data) @api.multi def print_project_report_xls(self): active_record = self._context['active_id'] record = self.env['project.project'].browse(active_record) data = { 'ids': self.ids, 'model': self._name, 'record': record.id, } return self.env.ref('project_report_pdf.project_xlsx').report_action(self, data=data)