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
06bf7b9c
Commit
06bf7b9c
authored
Oct 25, 2022
by
François C.
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ticket_3964' into 'dev_cooperatic'
Make remove 15 min at shift's end optional See merge request
!214
parents
9edc9237
278ce0b1
Pipeline
#2462
passed with stage
in 1 minute 23 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
config.md
outils/config.md
+4
-0
views.py
shifts/views.py
+5
-3
No files found.
outils/config.md
View file @
06bf7b9c
...
@@ -453,6 +453,10 @@
...
@@ -453,6 +453,10 @@
Define duration, in hours, before shift starts within exchange is not more available, for standard shift_type member
Define duration, in hours, before shift starts within exchange is not more available, for standard shift_type member
-
REMOVE_15_MINUTES_AT_SHIFT_END = False
True by default. Remove 15 minutes to Odoo shift end (https://redmine.cooperatic.fr/issues/1680)
### BDM Admin
### BDM Admin
-
BDM_SHOW_FTOP_BUTTON = True (by default)
-
BDM_SHOW_FTOP_BUTTON = True (by default)
...
...
shifts/views.py
View file @
06bf7b9c
...
@@ -99,7 +99,7 @@ def get_list_shift_calendar(request, partner_id):
...
@@ -99,7 +99,7 @@ def get_list_shift_calendar(request, partner_id):
registerPartner
=
cs
.
get_shift_partner
(
partner_id
)
registerPartner
=
cs
.
get_shift_partner
(
partner_id
)
use_new_members_space
=
getattr
(
settings
,
'USE_NEW_MEMBERS_SPACE'
,
False
)
use_new_members_space
=
getattr
(
settings
,
'USE_NEW_MEMBERS_SPACE'
,
False
)
remove_15_minutes_at_shift_end
=
getattr
(
settings
,
'REMOVE_15_MINUTES_AT_SHIFT_END'
,
True
)
listRegisterPartner
=
[]
listRegisterPartner
=
[]
listMakeUpShift
=
[]
listMakeUpShift
=
[]
for
v
in
registerPartner
:
for
v
in
registerPartner
:
...
@@ -113,8 +113,8 @@ def get_list_shift_calendar(request, partner_id):
...
@@ -113,8 +113,8 @@ def get_list_shift_calendar(request, partner_id):
events
=
[]
events
=
[]
for
value
in
listService
:
for
value
in
listService
:
events
.
append
(
value
)
if
value
[
'shift_type_id'
][
0
]
==
1
or
getattr
(
settings
,
'USE_STANDARD_SHIFT'
,
True
)
is
False
:
if
value
[
'shift_type_id'
][
0
]
==
1
or
getattr
(
settings
,
'USE_STANDARD_SHIFT'
,
True
)
is
False
:
# Standard ou volant si on n'utilise pas les services standards (config)
l
=
set
(
value
[
'registration_ids'
])
&
set
(
listRegisterPartner
)
l
=
set
(
value
[
'registration_ids'
])
&
set
(
listRegisterPartner
)
# if (int(value['seats_reserved']) == int(value['seats_max']) and len(l) > 0 ) or (int(value['seats_reserved']) < int(value['seats_max'])):
# if (int(value['seats_reserved']) == int(value['seats_max']) and len(l) > 0 ) or (int(value['seats_reserved']) < int(value['seats_max'])):
if
(
int
(
value
[
'seats_available'
])
>
0
or
len
(
l
)
>
0
):
if
(
int
(
value
[
'seats_available'
])
>
0
or
len
(
l
)
>
0
):
...
@@ -134,7 +134,9 @@ def get_list_shift_calendar(request, partner_id):
...
@@ -134,7 +134,9 @@ def get_list_shift_calendar(request, partner_id):
event
[
"start"
]
=
dateIsoUTC
(
value
[
'date_begin_tz'
])
event
[
"start"
]
=
dateIsoUTC
(
value
[
'date_begin_tz'
])
datetime_object
=
datetime
.
datetime
.
strptime
(
value
[
'date_end_tz'
],
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
)
-
datetime
.
timedelta
(
minutes
=
15
)
datetime_object
=
datetime
.
datetime
.
strptime
(
value
[
'date_end_tz'
],
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
)
if
remove_15_minutes_at_shift_end
is
True
:
datetime_object
-=
datetime
.
timedelta
(
minutes
=
15
)
event
[
"end"
]
=
dateIsoUTC
(
datetime_object
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
))
event
[
"end"
]
=
dateIsoUTC
(
datetime_object
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
))
if
len
(
l
)
>
0
:
if
len
(
l
)
>
0
:
...
...
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