forked from Yaltik/golem
[IMP]GOLEM Resource : add ordering
This commit is contained in:
parent
977e817326
commit
518d2c8348
@ -26,6 +26,7 @@ class GolemResource(models.Model):
|
||||
_name = 'golem.resource'
|
||||
_description = 'GOLEM Resource Model'
|
||||
_inherit = 'mail.thread'
|
||||
_order = 'name asc'
|
||||
|
||||
name = fields.Char(required=True, index=True)
|
||||
active = fields.Boolean(default=True)
|
||||
|
@ -28,6 +28,7 @@ class GolemResourceReservation(models.Model):
|
||||
_name = 'golem.resource.reservation'
|
||||
_description = 'GOLEM Reservation Model'
|
||||
_inherit = 'mail.thread'
|
||||
_order = 'date desc,hour_start asc'
|
||||
|
||||
name = fields.Char(compute='_compute_name', store=True)
|
||||
# TODO: handle multiple days reservation
|
||||
|
@ -26,6 +26,7 @@ class GolemTimetable(models.Model):
|
||||
_name = "golem.resource.timetable"
|
||||
_description = "Golem Timetable"
|
||||
_rec_name = 'weekday'
|
||||
_order = 'weekday asc,time_start asc'
|
||||
|
||||
resource_id = fields.Many2one('golem.resource', required=True,
|
||||
string='Linked resource')
|
||||
|
@ -24,6 +24,7 @@ class GolemResourceType(models.Model):
|
||||
""" GOLEM Resource Type """
|
||||
_name = 'golem.resource.type'
|
||||
_description = 'GOLEM Resource Type'
|
||||
_order = 'name asc'
|
||||
_sql_constraints = [('golem_resource_type_name_uniq',
|
||||
'UNIQUE (name)',
|
||||
'Resource type must be unique.')]
|
||||
|
Loading…
Reference in New Issue
Block a user