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
b81df9a3
Commit
b81df9a3
authored
May 23, 2022
by
François C.
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#3074 Prevent associated people to be granted more than once for having done shift together
parent
279197e3
Pipeline
#2213
failed with stage
in 2 minutes 28 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletions
+3
-1
models.py
members/models.py
+3
-1
No files found.
members/models.py
View file @
b81df9a3
...
...
@@ -1456,6 +1456,7 @@ class CagetteServices(models.Model):
# Let's start by adding an extra shift to associated member who came together
cond
=
[[
'date_begin'
,
'>='
,
date_24h_before
.
isoformat
()],
[
'date_begin'
,
'<='
,
end_date
.
isoformat
()],
[
'date_closed'
,
'='
,
False
],
[
'state'
,
'='
,
'done'
],
[
'associate_registered'
,
'='
,
'both'
]]
fields
=
[
'state'
,
'partner_id'
,
'date_begin'
]
res
=
api
.
search_read
(
'shift.registration'
,
cond
,
fields
)
...
...
@@ -1495,7 +1496,8 @@ class CagetteServices(models.Model):
(
_h
,
_m
,
_s
)
=
h
.
split
(
':'
)
if
int
(
_h
)
<
21
:
ids
.
append
(
int
(
r
[
'id'
]))
f
=
{
'state'
:
absence_status
}
# coop_logger.info("Traitement absences shift_registration ids %s", ids)
f
=
{
'state'
:
absence_status
,
'date_closed'
:
now
.
isoformat
()}
update_shift_reg_result
=
{
'update'
:
api
.
update
(
'shift.registration'
,
ids
,
f
),
'reg_shift'
:
res
}
if
update_shift_reg_result
[
'update'
]
is
True
:
update_shift_reg_result
[
'process_status_res'
]
=
api
.
execute
(
'res.partner'
,
'run_process_target_status'
,
[])
...
...
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