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
2d43394f
Commit
2d43394f
authored
Jul 25, 2023
by
Yvon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
a reopened shift registration can be reopened as a makeup and is now identified as reopened
parent
043e2a4b
Pipeline
#2829
failed with stage
in 1 minute 6 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
models.py
shifts/models.py
+4
-2
No files found.
shifts/models.py
View file @
2d43394f
...
...
@@ -306,13 +306,15 @@ class CagetteShift(models.Model):
cond
=
[[
'partner_id'
,
'='
,
int
(
data
[
'idPartner'
])],
[
'shift_id'
,
'='
,
int
(
data
[
'idShift'
])],
[
'state'
,
'='
,
'cancel'
]]
fields
=
[
'id'
]
fields
=
[
'id'
,
'origin'
]
try
:
canceled_res
=
self
.
o_api
.
search_read
(
'shift.registration'
,
cond
,
fields
,
1
)
if
(
len
(
canceled_res
)
==
1
):
shift_res
=
canceled_res
[
0
]
fieldsDatas
=
{
"related_shift_state"
:
'open'
,
"state"
:
'open'
}
"state"
:
'open'
,
"is_makeup"
:
data
[
'is_makeup'
],
"origin"
:
canceled_res
[
0
][
'origin'
]
+
' reopened from memberspace'
}
response
=
self
.
o_api
.
update
(
'shift.registration'
,
[
shift_res
[
'id'
]],
fieldsDatas
)
except
Exception
as
e
:
coop_logger
.
error
(
"Reopen shift :
%
s"
,
str
(
e
))
...
...
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