Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion shift/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
),
"website": "https://github.com/beescoop/Obeesdoo",
"category": "Cooperative management",
"version": "12.0.5.0.2",
"version": "12.0.5.0.3",
"depends": ["mail"],
"data": [
"data/system_parameter.xml",
Expand Down
2 changes: 1 addition & 1 deletion shift/models/cooperative_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class HistoryStatus(models.Model):
_name = "cooperative.status.history"
_description = "cooperative.status.history"

_order = "create_date desc"
_order = "create_date desc, id"

status_id = fields.Many2one("cooperative.status")
cooperator_id = fields.Many2one("res.partner")
Expand Down
6 changes: 3 additions & 3 deletions shift/models/planning.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class ShiftDayNumber(models.Model):
_name = "shift.daynumber"
_description = "shift.daynumber"

_order = "number asc"
_order = "number asc, id"

name = fields.Char()
number = fields.Integer(
Expand All @@ -55,7 +55,7 @@ class ShiftDayNumber(models.Model):
class ShiftPlanning(models.Model):
_name = "shift.planning"
_description = "shift.planning"
_order = "sequence asc"
_order = "sequence asc, id"

sequence = fields.Integer()
name = fields.Char()
Expand Down Expand Up @@ -198,7 +198,7 @@ def get_future_shifts(
class ShiftTemplate(models.Model):
_name = "shift.template"
_description = "shift.template"
_order = "start_time"
_order = "planning_id, task_type_id, start_time, id"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it intentional to heavily change the order here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is intentional. Ordering by "start_time" (knowing that start time is only a float value representing hours) has no sens.


name = fields.Char(required=True)
planning_id = fields.Many2one("shift.planning", required=True)
Expand Down
2 changes: 1 addition & 1 deletion shift/models/shift_shift.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
class ShiftShift(models.Model):
_name = "shift.shift"
_inherit = ["mail.thread"]
_order = "start_time asc"
_order = "start_time asc, task_template_id, task_type_id, worker_id, id"

##################################
# Method to override #
Expand Down