wizard pour choisir les resources

This commit is contained in:
eloyoussef 2018-04-11 21:27:07 +02:00
parent fa635b496e
commit 2abaabc002
7 changed files with 184 additions and 0 deletions

View File

@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Copyright 2018 Youssef El Ouahby <youssef@yaltik.com>
# Copyright 2018 Fabien Bourgeois <fabien@yaltik.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License 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 <http://www.gnu.org/licenses/>.
#from . import models
from . import wizard

View File

@ -0,0 +1,33 @@
# -*- coding: utf-8 -*-
# Copyright 2018 Youssef El Ouahby <youssef@yaltik.com>
# Copyright 2018 Fabien Bourgeois <fabien@yaltik.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License 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 <http://www.gnu.org/licenses/>.
{
'name': 'GOLEM resources reports',
'summary': 'GOLEM resources reports',
'description': ''' GOLEM resources reports ''',
'version': '10.0.0.0.0',
'category': 'GOLEM',
'author': 'Youssef El Ouahby, Fabien Bourgeois',
'license': 'AGPL-3',
'application': True,
'installable': True,
'depends': ['golem_resource'],
'data': ['reports/golem_reservation_report.xml',
'views/golem_resource_report_menu.xml',
'wizard/golem_resource_report_wizard_views.xml']
}

View File

@ -0,0 +1,8 @@
<?xml version="1.0"?>
<odoo>
<report id="action_golem_reservation_report"
string="Reservations"
model="golem.resource.report.wizard"
report_type="qweb-html"
name="golem_resource_report.report_golem_reservation_template"/>
</odoo>

View File

@ -0,0 +1,14 @@
<odoo>
<data>
<!-- Actions -->
<act_window id="golem_resource_report_action" name="Resources_reports"
res_model="golem.resource.report.wizard" view_mode="form" />
<!-- Menus -->
<menuitem id="resource_report_menu" name="Report" parent="golem_resource.golem_resource_menu"
action="golem_resource_report_action" sequence="10" />
</data>
</odoo>

View File

@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
# Copyright 2018 Youssef El Ouahby <youssef@yaltik.com>
# Copyright 2018 Fabien Bourgeois <fabien@yaltik.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License 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 <http://www.gnu.org/licenses/>.
from . import golem_resource_report_wizard

View File

@ -0,0 +1,38 @@
# -*- coding: utf-8 -*-
# Copyright 2018 Youssef El Ouahby <youssef@yaltik.com>
# Copyright 2018 Fabien Bourgeois <fabien@yaltik.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License 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 <http://www.gnu.org/licenses/>.
""" GOLEM Resources management """
from odoo import models, fields, api
class GolemResourceReportWizard(models.TransientModel):
"""GOLEM Resource wizard : refusal reason for a reservation """
_name = "golem.resource.report.wizard"
def _get_resources(self):
return self.env['golem.resource'].search([]).ids
resource_ids = fields.Many2many('golem.resource',default=_get_resources)
selected_resource_ids = fields.Many2many('golem.resource',
domaine="[('id', in, resources_ids.ids)]")
date_start = fields.Datetime(required=True)
date_stop = fields.Datetime(required=True)
@api.multi
def print_report(self):
for record in self:
pass

View File

@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2018 Youssef El Ouahby <youssef@yaltik.com>
Copyright 2018 Fabien Bourgeois <fabien@yaltik.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License 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 <http://www.gnu.org/licenses/>.
-->
<odoo>
<data>
<!-- Forms -->
<record model="ir.ui.view" id="golem_resource_report_wizard_view_form">
<field name="name">GOLEM resource Report Wizard Form</field>
<field name="model">golem.resource.report.wizard</field>
<field name="arch" type="xml">
<form string="Resource Report">
<group>
<group>
<field name="resource_ids" readonly="1" invisible="1"/>
<field name="selected_resource_ids" >
<tree>
<field name="name"/>
</tree>
</field>
</group>
<group>
<field name="date_start" />
<field name="date_stop" />
</group>
</group>
<footer>
<button name="print_report" string="Print Report" type="object"
class="oe_highlight" />
<button string="Cancel" class="oe_link" special="cancel" />
</footer>
</form>
</field>
</record>
</data>
</odoo>