Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
third-party
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cooperatic-foodcoops
third-party
Commits
2a6dd52c
Commit
2a6dd52c
authored
Jan 23, 2025
by
Yvon Kerdoncuff
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
properly set origin in set_shift
parent
8e1fb25c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
5 deletions
+10
-5
admin.py
members/admin.py
+2
-1
models.py
shifts/models.py
+3
-2
views.py
shifts/views.py
+5
-2
No files found.
members/admin.py
View file @
2a6dd52c
...
...
@@ -936,7 +936,8 @@ def handle_suppleant_scheduled_makeups_on_pairing(parent_id, child, child_schedu
'idPartner'
:
parent_id
,
'idShift'
:
child_scheduled_makeup
[
'shift_id'
][
0
],
'shift_type'
:
'standard'
,
'is_makeup'
:
True
'is_makeup'
:
True
,
'origin'
:
'Transfert d
\'
un rattrapage sur le titulaire à la création de binôme'
}
cs
.
set_shift
(
data
)
# Automaticaly decrements makeups_to_do to preserve total count.
parent_scheduled_makeups_length
=
parent_scheduled_makeups_length
+
1
...
...
shifts/models.py
View file @
2a6dd52c
...
...
@@ -303,6 +303,7 @@ class CagetteShift(models.Model):
- idShift
- shift_type
- is_makeup
- origin
"""
st_r_id
=
False
try
:
...
...
@@ -313,7 +314,7 @@ class CagetteShift(models.Model):
"shift_id"
:
data
[
'idShift'
],
"shift_ticket_id"
:
self
.
get_shift_ticket
(
data
[
'idShift'
],
data
[
'shift_type'
]),
"shift_type"
:
shift_type
,
"origin"
:
'memberspace'
,
"origin"
:
data
[
'origin'
]
,
"is_makeup"
:
data
[
'is_makeup'
],
"state"
:
'open'
}
if
(
shift_type
==
"standard"
and
data
[
'is_makeup'
]
is
not
True
)
or
shift_type
==
"ftop"
:
...
...
@@ -405,7 +406,7 @@ class CagetteShift(models.Model):
fieldsDatas
=
{
"related_shift_state"
:
'open'
,
"state"
:
'open'
,
"is_makeup"
:
data
[
'is_makeup'
],
"origin"
:
canceled_res
[
0
][
'origin'
]
+
' reopened
from memberspace'
}
"origin"
:
canceled_res
[
0
][
'origin'
]
+
' reopened
'
+
data
[
'origin'
]
}
#following code is required to properly set template_created.
#TODO : factor with set_shift code
...
...
shifts/views.py
View file @
2a6dd52c
...
...
@@ -196,7 +196,8 @@ def change_shift(request):
"idPartner"
:
int
(
request
.
POST
[
'idPartner'
]),
"idShift"
:
int
(
request
.
POST
[
'idNewShift'
]),
"shift_type"
:
request
.
POST
[
'shift_type'
],
"is_makeup"
:
cs
.
shift_is_makeup
(
listRegister
[
0
])
"is_makeup"
:
cs
.
shift_is_makeup
(
listRegister
[
0
]),
"origin"
:
"Espace membre : changement de service"
}
should_block_service_exchange
=
getattr
(
settings
,
'BLOCK_SERVICE_EXCHANGE_24H_BEFORE'
,
False
)
...
...
@@ -289,11 +290,13 @@ def add_shift(request):
"idPartner"
:
partner_id
,
"idShift"
:
id_shift
,
"shift_type"
:
request
.
POST
[
'shift_type'
],
"is_makeup"
:
False
"is_makeup"
:
False
,
"origin"
:
"Espace membre : ajout de service"
}
if
'is_makeup'
in
request
.
POST
and
request
.
POST
[
'is_makeup'
]
==
"1"
:
data
[
'is_makeup'
]
=
True
data
[
'origin'
]
=
"Espace membre : sélection de rattrapage"
if
request
.
POST
[
'shift_type'
]
==
"ftop"
:
if
cs
.
is_matching_ftop_rules
(
partner_id
,
id_shift
)
is
True
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment