Adding comments to views and fixing the availibility configuration

This commit is contained in:
eloyoussef 2018-02-08 00:58:23 +01:00
parent 25acf52d5e
commit 4cec863372
3 changed files with 34 additions and 16 deletions

View File

@ -34,7 +34,7 @@ class GolemResources(models.Model):
start_of_availability_date = fields.Date(string="Start of availibility date ") start_of_availability_date = fields.Date(string="Start of availibility date ")
end_of_availability_date = fields.Date(string="End of availibility date ") end_of_availability_date = fields.Date(string="End of availibility date ")
weekdays_of_availibility = fields.Many2many('golem.weekday', string="Weekdays of availibility") weekdays_of_availibility = fields.Many2many('golem.weekday', string="Weekdays of availibility")
#horaire = fields.Many2many("golem.hour", string="horaire ") timetable = fields.One2many("golem.timetable", "resource_id", string="Availibility timetable")
@api.multi @api.multi
def active_change(self): def active_change(self):
@ -88,10 +88,10 @@ class GolemWeekDay(models.Model):
name = fields.Char(string='Week Day') name = fields.Char(string='Week Day')
#modèle de gestion horaire #modèle de gestion horaire
class GolemHour(models.Model): class GolemTimetable(models.Model):
""" Golem Hour """ """ Golem Timetable """
_name = "golem.hour" _name = "golem.timetable"
_description = "Golem Hour" _description = "Golem Timetable"
resource_id = fields.Many2one("golem.resources", required=True) resource_id = fields.Many2one("golem.resources", required=True)
name = fields.Many2one("golem.weekday", required=True) name = fields.Many2one("golem.weekday", required=True)

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
Copyright 2017 Fabien Bourgeois <fabien@yaltik.com> Copyright 2018 Fabien Bourgeois <fabien@yaltik.com>
This program is free software: you can redistribute it and/or modify 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 it under the terms of the GNU Affero General Public License as published by

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
Copyright 2017 Fabien Bourgeois <fabien@yaltik.com> Copyright 2018 Fabien Bourgeois <fabien@yaltik.com>
This program is free software: you can redistribute it and/or modify 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 it under the terms of the GNU Affero General Public License as published by
@ -17,6 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
--> -->
<odoo> <odoo>
<data> <data>
<!-- Remplissage du modele golem.weekday par les jours de la semaine -->
<record model="golem.weekday" id="1"> <record model="golem.weekday" id="1">
<field name="name">Sunday</field> <field name="name">Sunday</field>
</record> </record>
@ -38,6 +39,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<record model="golem.weekday" id="7"> <record model="golem.weekday" id="7">
<field name="name">Saturday</field> <field name="name">Saturday</field>
</record> </record>
<!--formulaire de recherche et filtrage du modèle golem.resources-->
<record model="ir.ui.view" id="resource_search_view"> <record model="ir.ui.view" id="resource_search_view">
<field name="name">resource.search</field> <field name="name">resource.search</field>
<field name="model">golem.resources</field> <field name="model">golem.resources</field>
@ -50,6 +54,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</search> </search>
</field> </field>
</record> </record>
<!--liste d'affichage du modèle golem.resources-->
<record model="ir.ui.view" id="resource_tree_view"> <record model="ir.ui.view" id="resource_tree_view">
<field name="name">resource.tree</field> <field name="name">resource.tree</field>
<field name="model">golem.resources</field> <field name="model">golem.resources</field>
@ -65,6 +71,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</tree> </tree>
</field> </field>
</record> </record>
<!--formulaire du modèle golem.resources-->
<record model="ir.ui.view" id="resource_form_view"> <record model="ir.ui.view" id="resource_form_view">
<field name="name">resource.form</field> <field name="name">resource.form</field>
<field name="model">golem.resources</field> <field name="model">golem.resources</field>
@ -79,17 +87,24 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<sheet> <sheet>
<group colspan="2"> <group colspan="2">
<group colspan="4" col="4"> <group colspan="4" col="4">
<field name="name"/> <field name="name"/>
<field name="resource_type"/> <field name="resource_type"/>
<field name="resource_responsible"/> <field name="resource_responsible"/>
<field name="article_link"/> <field name="article_link"/>
</group> </group>
<group colspan="3"> <group colspan="3">
<separator string="Availibility configuration" colspan="3"/> <separator string="Availibility configuration" colspan="3"/>
<field name="start_of_availability_date"/> <field name="start_of_availability_date"/>
<field name="end_of_availability_date"/> <field name="end_of_availability_date"/>
<field name="weekdays_of_availibility" widget="many2many_tags" options="{'no_create_edit':'1'}"/> <field name="weekdays_of_availibility" widget="many2many_tags" options="{'no_create_edit':'1'}"/>
<field name="horaire"/> <field name="timetable">
<tree editable="bottom" context="{'default_resource_id': active_id}">
<field name="resource_id" invisible="1" />
<field name="name" />
<field name="start_time" />
<field name="end_time" />
</tree>
</field>
</group> </group>
</group> </group>
</sheet> </sheet>
@ -97,11 +112,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</field> </field>
</record> </record>
<!--action du sous menu Resources-->
<record model="ir.actions.act_window" id="action_resources"> <record model="ir.actions.act_window" id="action_resources">
<field name="name">Resources</field> <field name="name">Resources</field>
<field name="res_model">golem.resources</field> <field name="res_model">golem.resources</field>
<field name="view_mode">tree,form,search</field> <field name="view_mode">tree,form,search</field>
</record> </record>
<!--menu principale et sous menu-->
<menuitem id="resources_menu" name="Resources" sequence="10"/> <menuitem id="resources_menu" name="Resources" sequence="10"/>
<menuitem id="resources_sub_menu" name="Resources" parent="resources_menu" <menuitem id="resources_sub_menu" name="Resources" parent="resources_menu"
action="action_resources"/> action="action_resources"/>