forked from Yaltik/golem
Ajout d'un modèle hour pour la gestion des horaires de disponibilité
This commit is contained in:
parent
7eda2d4a98
commit
25acf52d5e
@ -25,6 +25,7 @@ class GolemResources(models.Model):
|
||||
_description = 'GOLEM Resources'
|
||||
|
||||
name = fields.Char()
|
||||
active = fields.Boolean(default=False)
|
||||
resource_type = fields.Many2one("golem.resourcetype", string="Resource type")
|
||||
resource_responsible = fields.Many2one("res.partner", string="Resource Responsible")
|
||||
article_link = fields.Many2one("product.template", string="Article Link")
|
||||
@ -33,6 +34,13 @@ class GolemResources(models.Model):
|
||||
start_of_availability_date = fields.Date(string="Start 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")
|
||||
#horaire = fields.Many2many("golem.hour", string="horaire ")
|
||||
|
||||
@api.multi
|
||||
def active_change(self):
|
||||
self.active = not self.active
|
||||
|
||||
|
||||
|
||||
#modèle gestion des reservation
|
||||
class GolemReservation(models.Model):
|
||||
@ -78,3 +86,14 @@ class GolemWeekDay(models.Model):
|
||||
_description = 'GOLEM Week Day'
|
||||
|
||||
name = fields.Char(string='Week Day')
|
||||
|
||||
#modèle de gestion horaire
|
||||
class GolemHour(models.Model):
|
||||
""" Golem Hour """
|
||||
_name = "golem.hour"
|
||||
_description = "Golem Hour"
|
||||
|
||||
resource_id = fields.Many2one("golem.resources", required=True)
|
||||
name = fields.Many2one("golem.weekday", required=True)
|
||||
start_time = fields.Float(required=True)
|
||||
end_time = fields.Float(required=True)
|
||||
|
@ -70,6 +70,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
<field name="model">golem.resources</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Resource Form">
|
||||
<header>
|
||||
<button class="oe_right oe_stat_button" name="active_change" type="object"
|
||||
icon="fa-pencil-square-o" align="right">
|
||||
<field name="active" widget="statinfo"/>
|
||||
</button>
|
||||
</header>
|
||||
<sheet>
|
||||
<group colspan="2">
|
||||
<group colspan="4" col="4">
|
||||
@ -83,6 +89,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
<field name="start_of_availability_date"/>
|
||||
<field name="end_of_availability_date"/>
|
||||
<field name="weekdays_of_availibility" widget="many2many_tags" options="{'no_create_edit':'1'}"/>
|
||||
<field name="horaire"/>
|
||||
</group>
|
||||
</group>
|
||||
</sheet>
|
||||
|
Loading…
Reference in New Issue
Block a user