diff --git a/golem_resource_pack/__manifest__.py b/golem_resource_pack/__manifest__.py index 1d76008..1d5a6e6 100644 --- a/golem_resource_pack/__manifest__.py +++ b/golem_resource_pack/__manifest__.py @@ -20,7 +20,7 @@ 'name': 'GOLEM resources pack', 'summary': 'GOLEM resources pack', 'description': ''' GOLEM resources pack ''', - 'version': '10.0.0.0.0', + 'version': '10.0.0.0.1', 'category': 'GOLEM', 'author': 'Youssef El Ouahby, Fabien Bourgeois', 'license': 'AGPL-3', diff --git a/golem_resource_pack/models/__init__.py b/golem_resource_pack/models/__init__.py index 35a9273..ea2f68b 100644 --- a/golem_resource_pack/models/__init__.py +++ b/golem_resource_pack/models/__init__.py @@ -16,4 +16,5 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -from . import golem_resource_pack +from . import golem_resource_pack, \ + golem_resource_reservation diff --git a/golem_resource_pack/models/golem_resource_pack.py b/golem_resource_pack/models/golem_resource_pack.py index 4fdc9ba..028c7af 100644 --- a/golem_resource_pack/models/golem_resource_pack.py +++ b/golem_resource_pack/models/golem_resource_pack.py @@ -28,3 +28,11 @@ class GolemResourcePack(models.Model): _description = 'GOLEM Resource Pack Model' name = fields.Char()#compute='_compute_name', store=True) + reservation_ids = fields.One2many('golem.resource.reservation', 'pack_id') + + note = fields.Text(help='Notes, optional subject for the reservation, reason') + + user_id = fields.Many2one('res.users', required=True, index=True, readonly=True, + string='User', default=lambda self: self.env.user) + partner_id = fields.Many2one('res.partner', string='On behalf of', + required=True, index=True) diff --git a/golem_resource_pack/models/golem_resource_reservation.py b/golem_resource_pack/models/golem_resource_reservation.py new file mode 100644 index 0000000..bf4c7c6 --- /dev/null +++ b/golem_resource_pack/models/golem_resource_reservation.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- + +# Copyright 2018 Youssef El Ouahby +# Copyright 2018 Fabien Bourgeois +# +# 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 . + +""" GOLEM Resource Reservation """ + +from math import modf +from datetime import timedelta +from odoo import models, fields, api, _ +from odoo.exceptions import ValidationError + + +class GolemResourceReservation(models.Model): + """ GOLEM Resource Reservation Model """ + _inherit = 'golem.resource.reservation' + + pack_id = fields.Many2one('golem_resource_reservation', 'Reservation Pack') diff --git a/golem_resource_pack/views/golem_resource_pack_views.xml b/golem_resource_pack/views/golem_resource_pack_views.xml index 465a589..6b0b0ad 100644 --- a/golem_resource_pack/views/golem_resource_pack_views.xml +++ b/golem_resource_pack/views/golem_resource_pack_views.xml @@ -35,29 +35,24 @@ along with this program. If not, see . --> - + - - - - - - - - - - - - - - - - - - + + + + + -
+ - --> + + res_model="golem.resource.pack" view_mode="tree,form" />