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
629f108f
Commit
629f108f
authored
Jan 23, 2025
by
Yvon Kerdoncuff
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#7345 : remove more code related to extensions/delay
parent
4c1f03cb
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
19 additions
and
89 deletions
+19
-89
admin.py
members/admin.py
+0
-7
models.py
members/models.py
+2
-2
manage_makeups.js
members/static/js/admin/manage_makeups.js
+0
-19
members-space-my-info.css
members_space/static/css/members-space-my-info.css
+1
-1
members-space-shifts-exchange.css
members_space/static/css/members-space-shifts-exchange.css
+1
-16
members-space.css
members_space/static/css/members-space.css
+1
-1
members-space.js
members_space/static/js/members-space.js
+4
-10
views.py
members_space/views.py
+0
-6
models.py
shifts/models.py
+2
-11
home.html
templates/members_space/home.html
+2
-2
index.html
templates/members_space/index.html
+0
-2
my_info.html
templates/members_space/my_info.html
+2
-2
shifts_exchange.html
templates/members_space/shifts_exchange.html
+0
-6
home.html
templates/members_space/supercafoutch/home.html
+2
-2
home.html
templates/members_space/supercoop/home.html
+2
-2
No files found.
members/admin.py
View file @
629f108f
...
...
@@ -122,13 +122,6 @@ default_msettings = {'msg_accueil': {'title': 'Message borne accueil',
'class'
:
'link'
,
'sort_order'
:
16
},
'member_cant_have_delay_form_link'
:
{
'title'
:
'Lien vers le formulaire pour les membres n
\'
ayant pas rattrapé leur service après la durée de l
\'
extension'
,
'type'
:
'text'
,
'value'
:
''
,
'class'
:
'link'
,
'sort_order'
:
21
},
'on_picking_shift_template_msg'
:
{
'title'
:
'Afficher une info à la sélection d
\'
un créneau (jour,heure) en respectant la syntaxe en exemple : lundi 14:00 Ici votre message'
,
'type'
:
'text'
,
...
...
members/models.py
View file @
629f108f
...
...
@@ -180,7 +180,7 @@ class CagetteMember(models.Model):
'amount_subscription'
,
'active_tmpl_reg_line_count'
,
'is_exempted'
,
'shift_type'
,
'current_template_name'
,
'final_standard_point'
,
'final_ftop_point'
,
'date_alert_stop'
,
'date_delay_stop'
,
'sex'
]
'date_alert_stop'
,
'sex'
]
else
:
fields
=
[
'name'
,
'email'
,
'birthdate_date'
,
'sex'
,
'country_id'
,
'total_partner_owned_share'
,
...
...
@@ -1354,7 +1354,7 @@ class CagetteMembers(models.Model):
if
len
(
ids
)
>
0
:
cond
.
append
([
'id'
,
'in'
,
ids
])
fields
=
[
'id'
,
'name'
,
'display_std_points'
,
'display_ftop_points'
,
'shift_type'
,
'makeups_to_do'
,
'date_delay_stop'
]
fields
=
[
'id'
,
'name'
,
'display_std_points'
,
'display_ftop_points'
,
'shift_type'
,
'makeups_to_do'
]
res
=
api
.
search_read
(
'res.partner'
,
cond
,
fields
)
# There are two things we need to do now :
...
...
members/static/js/admin/manage_makeups.js
View file @
629f108f
...
...
@@ -73,25 +73,6 @@ function display_makeups_members() {
title
:
"Nom"
},
{
data
:
"id"
,
title
:
""
,
className
:
"dt-body-center"
,
orderable
:
false
,
width
:
"10%"
,
render
:
function
(
data
,
type
,
row
)
{
return
`<button class="btn--primary extend_delay_button" data-member-id="
${
row
.
id
}
">Augmenter le délai</button>`
;
}
},
{
data
:
"date_delay_stop"
,
title
:
"<div class='title_center'>Limite du délai</div>"
,
className
:
"dt-body-center"
,
width
:
"10%"
,
render
:
function
(
data
)
{
return
(
data
===
false
)
?
"Pas de délai en cours"
:
new
Date
(
data
).
toLocaleDateString
();
}
},
{
data
:
"shift_type"
,
title
:
"<div class='title_center'>Type de créneau</div>"
,
className
:
"dt-body-center"
,
...
...
members_space/static/css/members-space-my-info.css
View file @
629f108f
...
...
@@ -136,7 +136,7 @@
white-space
:
normal
;
}
#my_info
.
delay
_date_stop_container
{
#my_info
.
leave
_date_stop_container
{
white-space
:
nowrap
;
}
...
...
members_space/static/css/members-space-shifts-exchange.css
View file @
629f108f
...
...
@@ -13,25 +13,10 @@
text-align
:
center
;
}
#shifts_exchange
.select_makeups
,
#shifts_exchange
.unsuscribed_form_link
,
.cant_have_delay_form_link
{
#shifts_exchange
.select_makeups
,
#shifts_exchange
.unsuscribed_form_link
{
margin
:
1.5rem
0
;
}
/* -- Suspended can't have delay screen */
#suspended_cant_have_delay_content
{
align-items
:
center
;
text-align
:
center
;
width
:
50%
;
}
@media
screen
and
(
max-width
:
992px
)
{
#suspended_cant_have_delay_content
{
align-items
:
center
;
text-align
:
center
;
width
:
90%
;
}
}
/* -- Calendar screen, area on top of the calendar */
#calendar_top_info
{
...
...
members_space/static/css/members-space.css
View file @
629f108f
...
...
@@ -235,7 +235,7 @@ body {
}
}
.
delay
_date_stop_container
{
.
leave
_date_stop_container
{
color
:
#f0ad4e
;
margin-top
:
-1rem
;
margin-bottom
:
1rem
;
...
...
members_space/static/js/members-space.js
View file @
629f108f
...
...
@@ -176,13 +176,7 @@ function init_my_info_data() {
.
text
(
possible_cooperative_state
[
partner_data
.
cooperative_state
])
.
addClass
(
"member_status_"
+
partner_data
.
cooperative_state
);
if
(
partner_data
.
cooperative_state
===
'delay'
&&
partner_data
.
date_delay_stop
!==
'False'
)
{
const
d
=
new
Date
(
Date
.
parse
(
partner_data
.
date_delay_stop
));
const
f_date_delay_stop
=
d
.
getDate
()
+
'/'
+
(
"0"
+
(
d
.
getMonth
()
+
1
)).
slice
(
-
2
)
+
'/'
+
d
.
getFullYear
();
$
(
".delay_date_stop"
).
text
(
f_date_delay_stop
);
$
(
".delay_date_stop_container"
).
show
();
}
else
if
(
partner_data
.
cooperative_state
===
'unsubscribed'
||
partner_data
.
cooperative_state
===
'gone'
)
{
if
(
partner_data
.
cooperative_state
===
'unsubscribed'
||
partner_data
.
cooperative_state
===
'gone'
)
{
$
(
".member_shift_name"
).
text
(
'X'
);
$
(
".unsuscribed_form_link"
)
...
...
@@ -195,10 +189,10 @@ function init_my_info_data() {
});
}
else
if
(
partner_data
.
cooperative_state
===
'exempted'
)
{
const
d
=
new
Date
(
Date
.
parse
(
partner_data
.
leave_stop_date
));
const
f_date_
delay
_stop
=
d
.
getDate
()
+
'/'
+
(
"0"
+
(
d
.
getMonth
()
+
1
)).
slice
(
-
2
)
+
'/'
+
d
.
getFullYear
();
const
f_date_
leave
_stop
=
d
.
getDate
()
+
'/'
+
(
"0"
+
(
d
.
getMonth
()
+
1
)).
slice
(
-
2
)
+
'/'
+
d
.
getFullYear
();
$
(
".
delay_date_stop"
).
text
(
f_date_delay
_stop
);
$
(
".
delay
_date_stop_container"
).
show
();
$
(
".
leave_date_stop"
).
text
(
f_date_leave
_stop
);
$
(
".
leave
_date_stop_container"
).
show
();
}
if
(
...
...
members_space/views.py
View file @
629f108f
...
...
@@ -109,13 +109,10 @@ def index(request, exception=None):
md5_calc
=
hashlib
.
md5
(
partnerData
[
'parent_create_date'
]
.
encode
(
'utf-8'
))
.
hexdigest
()
partnerData
[
'parent_verif_token'
]
=
md5_calc
partnerData
[
'makeups_to_do'
]
=
partnerData
[
'parent_makeups_to_do'
]
partnerData
[
'date_delay_stop'
]
=
partnerData
[
'parent_date_delay_stop'
]
partnerData
[
'can_have_delay'
]
=
cs
.
member_can_have_delay
(
int
(
partnerData
[
"parent_id"
]))
partnerData
[
'extra_shift_done'
]
=
partnerData
[
"parent_extra_shift_done"
]
else
:
partnerData
[
"parent_name"
]
=
False
partnerData
[
'can_have_delay'
]
=
cs
.
member_can_have_delay
(
int
(
partner_id
))
# look for associated partner for parents
cm
=
CagetteMember
(
partner_id
)
...
...
@@ -157,9 +154,6 @@ def index(request, exception=None):
context
[
'unsuscribe_form_link'
]
=
(
msettings
[
'unsuscribe_form_link'
][
'value'
]
if
'unsuscribe_form_link'
in
msettings
else
''
)
context
[
'member_cant_have_delay_form_link'
]
=
(
msettings
[
'member_cant_have_delay_form_link'
][
'value'
]
if
'member_cant_have_delay_form_link'
in
msettings
else
''
)
context
[
'abcd_calendar_link'
]
=
(
msettings
[
'abcd_calendar_link'
][
'value'
]
if
'abcd_calendar_link'
in
msettings
else
''
)
...
...
shifts/models.py
View file @
629f108f
...
...
@@ -178,7 +178,7 @@ class CagetteShift(models.Model):
"""Retrieve partner data useful to make decision about shift options"""
cond
=
[[
'id'
,
'='
,
id
]]
fields
=
[
'display_name'
,
'display_std_points'
,
'shift_type'
,
'date_alert_stop'
,
'
date_delay_stop'
,
'
extension_ids'
,
'shift_type'
,
'date_alert_stop'
,
'extension_ids'
,
'cooperative_state'
,
'final_standard_point'
,
'create_date'
,
'final_ftop_point'
,
'shift_type'
,
'leave_ids'
,
'makeups_to_do'
,
'barcode_base'
,
'street'
,
'street2'
,
'zip'
,
'city'
,
'mobile'
,
'phone'
,
'function'
,
'email'
,
...
...
@@ -188,12 +188,11 @@ class CagetteShift(models.Model):
partnerData
=
partnerData
[
0
]
if
partnerData
[
'suppleant_member_id'
]:
cond
=
[[
'id'
,
'='
,
partnerData
[
'parent_id'
][
0
]]]
fields
=
[
'create_date'
,
'makeups_to_do'
,
'
date_delay_stop'
,
'
extra_shift_done'
]
fields
=
[
'create_date'
,
'makeups_to_do'
,
'extra_shift_done'
]
parentData
=
self
.
o_api
.
search_read
(
'res.partner'
,
cond
,
fields
,
1
)
if
parentData
:
partnerData
[
'parent_create_date'
]
=
parentData
[
0
][
'create_date'
]
partnerData
[
'parent_makeups_to_do'
]
=
parentData
[
0
][
'makeups_to_do'
]
partnerData
[
'parent_date_delay_stop'
]
=
parentData
[
0
][
'date_delay_stop'
]
partnerData
[
'parent_extra_shift_done'
]
=
parentData
[
0
][
'extra_shift_done'
]
if
partnerData
[
'shift_type'
]
==
'standard'
:
...
...
@@ -469,14 +468,6 @@ class CagetteShift(models.Model):
fields
=
[
'makeups_to_do'
]
return
self
.
o_api
.
search_read
(
'res.partner'
,
cond
,
fields
)[
0
][
"makeups_to_do"
]
def
member_can_have_delay
(
self
,
partner_id
):
""" Can a member have a delay? """
answer
=
False
try
:
answer
=
self
.
o_api
.
execute
(
'res.partner'
,
'can_have_extension'
,
[
partner_id
])
except
Exception
as
e
:
coop_logger
.
error
(
"member_can_have_delay :
%
s"
,
str
(
e
))
return
answer
def
update_counter_event
(
self
,
fields
):
""" Add/remove points """
...
...
templates/members_space/home.html
View file @
629f108f
...
...
@@ -11,8 +11,8 @@
<div
class=
"tile_content"
>
{#
<p><span
class=
"member_info member_name"
></span></p>
#}
<p
class=
"member_status_text_container"
>
Mon statut :
<span
class=
"member_info member_status"
></span></p>
<div
class=
"
delay
_date_stop_container"
>
( jusqu'au
<span
class=
"
delay
_date_stop"
></span>
)
<div
class=
"
leave
_date_stop_container"
>
( jusqu'au
<span
class=
"
leave
_date_stop"
></span>
)
</div>
<div
id=
"member_status_action"
>
<a
href=
"#"
target=
"_blank"
class=
"btn--warning unsuscribed_form_link"
>
...
...
templates/members_space/index.html
View file @
629f108f
...
...
@@ -129,7 +129,6 @@
var
helper_unsubscribe_form_link
=
'{{helper_unsubscribe_form_link}}'
;
var
covid_form_link
=
'{{covid_form_link}}'
;
var
covid_end_form_link
=
'{{covid_end_form_link}}'
;
var
member_cant_have_delay_form_link
=
'{{member_cant_have_delay_form_link}}'
;
var
abcd_calendar_link
=
"{{abcd_calendar_link}}"
var
days_to_hide
=
"{{daysToHide}}"
var
on_picking_shift_template_msg
=
"{{on_picking_shift_template_msg}}"
...
...
@@ -140,7 +139,6 @@
"date_delay_stop"
:
"{{partnerData.date_delay_stop}}"
,
"cooperative_state"
:
"{{partnerData.cooperative_state}}"
,
"regular_shift_name"
:
"{{partnerData.regular_shift_name}}"
,
"can_have_delay"
:
"{{partnerData.can_have_delay}}"
,
"makeups_to_do"
:
"{{partnerData.makeups_to_do}}"
,
"barcode_base"
:
"{{partnerData.barcode_base}}"
,
"street"
:
"{{partnerData.street}}"
,
...
...
templates/members_space/my_info.html
View file @
629f108f
...
...
@@ -15,8 +15,8 @@
</div>
<div
class=
"my_info_line_right"
>
<p
class=
"member_info member_status"
></p>
<div
class=
"
delay
_date_stop_container"
>
( jusqu'au
<span
class=
"
delay
_date_stop"
></span>
)
<div
class=
"
leave
_date_stop_container"
>
( jusqu'au
<span
class=
"
leave
_date_stop"
></span>
)
</div>
<div
id=
"member_status_action"
>
<a
href=
"#"
target=
"_blank"
class=
"btn--warning unsuscribed_form_link"
>
...
...
templates/members_space/shifts_exchange.html
View file @
629f108f
...
...
@@ -5,12 +5,6 @@
J'accède au formulaire
</a>
</div>
<div
id=
"suspended_cant_have_delay_content"
class=
"shifts_exchange_page_content"
>
<div
class=
"suspended_cant_have_delay_msg"
></div>
<a
href=
"#"
target=
"_blank"
class=
"btn--warning cant_have_delay_form_link"
>
J'accède au formulaire
</a>
</div>
<div
id=
"comite_content"
class=
"shifts_exchange_page_content"
>
<div
class=
"comite_content_msg"
></div>
<div
id=
"read_only_calendar"
></div>
...
...
templates/members_space/supercafoutch/home.html
View file @
629f108f
...
...
@@ -11,8 +11,8 @@
<div
class=
"tile_content"
>
{#
<p><span
class=
"member_info member_name"
></span></p>
#}
<p
class=
"member_status_text_container"
>
Mon statut :
<span
class=
"member_info member_status"
></span></p>
<div
class=
"
delay
_date_stop_container"
>
( jusqu'au
<span
class=
"
delay
_date_stop"
></span>
)
<div
class=
"
leave
_date_stop_container"
>
( jusqu'au
<span
class=
"
leave
_date_stop"
></span>
)
</div>
<div
id=
"member_status_action"
>
<button
type=
"button"
class=
"btn--danger choose_makeups"
>
...
...
templates/members_space/supercoop/home.html
View file @
629f108f
...
...
@@ -18,8 +18,8 @@
<div
class=
"tile_content"
>
{#
<p><span
class=
"member_info member_name"
></span></p>
#}
<p
class=
"member_status_text_container"
>
Mon statut :
<span
class=
"member_info member_status"
></span></p>
<div
class=
"
delay
_date_stop_container"
>
( jusqu'au
<span
class=
"
delay
_date_stop"
></span>
)
<div
class=
"
leave
_date_stop_container"
>
( jusqu'au
<span
class=
"
leave
_date_stop"
></span>
)
</div>
<div
id=
"member_status_action"
>
<a
href=
"#"
target=
"_blank"
class=
"btn--warning unsuscribed_form_link"
>
...
...
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