[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'
|
_name = 'golem.resource'
|
||||||
_description = 'GOLEM Resource Model'
|
_description = 'GOLEM Resource Model'
|
||||||
_inherit = 'mail.thread'
|
_inherit = 'mail.thread'
|
||||||
|
_order = 'name asc'
|
||||||
|
|
||||||
name = fields.Char(required=True, index=True)
|
name = fields.Char(required=True, index=True)
|
||||||
active = fields.Boolean(default=True)
|
active = fields.Boolean(default=True)
|
||||||
|
@ -28,6 +28,7 @@ class GolemResourceReservation(models.Model):
|
|||||||
_name = 'golem.resource.reservation'
|
_name = 'golem.resource.reservation'
|
||||||
_description = 'GOLEM Reservation Model'
|
_description = 'GOLEM Reservation Model'
|
||||||
_inherit = 'mail.thread'
|
_inherit = 'mail.thread'
|
||||||
|
_order = 'date desc,hour_start asc'
|
||||||
|
|
||||||
name = fields.Char(compute='_compute_name', store=True)
|
name = fields.Char(compute='_compute_name', store=True)
|
||||||
# TODO: handle multiple days reservation
|
# TODO: handle multiple days reservation
|
||||||
|
@ -26,6 +26,7 @@ class GolemTimetable(models.Model):
|
|||||||
_name = "golem.resource.timetable"
|
_name = "golem.resource.timetable"
|
||||||
_description = "Golem Timetable"
|
_description = "Golem Timetable"
|
||||||
_rec_name = 'weekday'
|
_rec_name = 'weekday'
|
||||||
|
_order = 'weekday asc,time_start asc'
|
||||||
|
|
||||||
resource_id = fields.Many2one('golem.resource', required=True,
|
resource_id = fields.Many2one('golem.resource', required=True,
|
||||||
string='Linked resource')
|
string='Linked resource')
|
||||||
|
@ -24,6 +24,7 @@ class GolemResourceType(models.Model):
|
|||||||
""" GOLEM Resource Type """
|
""" GOLEM Resource Type """
|
||||||
_name = 'golem.resource.type'
|
_name = 'golem.resource.type'
|
||||||
_description = 'GOLEM Resource Type'
|
_description = 'GOLEM Resource Type'
|
||||||
|
_order = 'name asc'
|
||||||
_sql_constraints = [('golem_resource_type_name_uniq',
|
_sql_constraints = [('golem_resource_type_name_uniq',
|
||||||
'UNIQUE (name)',
|
'UNIQUE (name)',
|
||||||
'Resource type must be unique.')]
|
'Resource type must be unique.')]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user