Ajout du champs de la disponiblité total sur la resource

This commit is contained in:
eloyoussef 2018-03-09 13:54:52 +01:00
parent b895de05ba
commit 5163b7535c
2 changed files with 7 additions and 2 deletions

View File

@ -49,6 +49,8 @@ class GolemResource(models.Model):
reservation_ids = fields.One2many('golem.resource.reservation', 'resource_id',
string='Reservations')
availibility_24_7 = fields.Boolean(string='24/7 availibility')
@api.multi
def active_toggle(self):
""" Toggles active boolean """

View File

@ -64,13 +64,16 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<group string="Availibility configuration">
<group colspan="2">
<field name="id" invisible="1"/>
<field name="availibility_24_7"/>
<field name="avaibility_start" />
<field name="avaibility_stop" />
</group>
<p attrs="{'invisible': [('id', '!=', False)]}">
<p attrs="{'invisible': ['|',
('id', '!=', False),
('availibility_24_7', '=', True)]}">
Please save the resource before fixing the timetable availibility"
</p>
<group colspan="2">
<group colspan="2" attrs="{'invisible': [('availibility_24_7', '=', True)]}">
<field name="timetable_ids"
context="{'default_resource_id': active_id}"
attrs="{'readonly': [('id', '=', False)]}" />