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
aca0b309
Commit
aca0b309
authored
Oct 12, 2023
by
Yvon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add column, rewording and change column order
parent
4def3c86
Pipeline
#3047
failed with stage
in 1 minute 30 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
16 deletions
+40
-16
models.py
members/models.py
+16
-2
manage_makeups.js
members/static/js/admin/manage_makeups.js
+23
-13
manage_makeups.html
templates/members/admin/manage_makeups.html
+1
-1
No files found.
members/models.py
View file @
aca0b309
...
@@ -845,8 +845,9 @@ class CagetteMember(models.Model):
...
@@ -845,8 +845,9 @@ class CagetteMember(models.Model):
elif
search_type
==
"makeups_data"
:
elif
search_type
==
"makeups_data"
:
fields
=
CagetteMember
.
m_short_default_fields
fields
=
CagetteMember
.
m_short_default_fields
fields
=
fields
+
[
'shift_type'
,
'makeups_to_do'
,
'display_ftop_points'
,
'display_std_points'
,
'shift_type'
]
fields
=
fields
+
[
'shift_type'
,
'makeups_to_do'
,
'display_ftop_points'
,
'display_std_points'
,
'shift_type'
]
return
api
.
search_read
(
'res.partner'
,
cond
,
fields
)
res
=
api
.
search_read
(
'res.partner'
,
cond
,
fields
)
CagetteMembers
.
add_makeups_to_come_to_member_data
(
res
)
return
res
elif
search_type
==
"shift_template_data"
:
elif
search_type
==
"shift_template_data"
:
fields
=
CagetteMember
.
m_short_default_fields
fields
=
CagetteMember
.
m_short_default_fields
fields
=
fields
+
[
'id'
,
'makeups_to_do'
,
'cooperative_state'
,
'parent_name'
]
fields
=
fields
+
[
'id'
,
'makeups_to_do'
,
'cooperative_state'
,
'parent_name'
]
...
@@ -1282,9 +1283,18 @@ class CagetteMembers(models.Model):
...
@@ -1282,9 +1283,18 @@ class CagetteMembers(models.Model):
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'
,
'date_delay_stop'
]
res
=
api
.
search_read
(
'res.partner'
,
cond
,
fields
)
res
=
api
.
search_read
(
'res.partner'
,
cond
,
fields
)
CagetteMembers
.
add_makeups_to_come_to_member_data
(
res
)
return
res
return
res
@staticmethod
@staticmethod
def
add_makeups_to_come_to_member_data
(
res
):
if
res
:
cs
=
CagetteShift
()
for
idx
,
partner
in
enumerate
(
res
):
shift_data
=
cs
.
get_shift_partner
(
int
(
partner
[
'id'
]))
res
[
idx
][
'makeups_to_come'
]
=
sum
(
1
for
value
in
shift_data
if
value
[
'is_makeup'
])
@staticmethod
def
get_attached_members
():
def
get_attached_members
():
api
=
OdooAPI
()
api
=
OdooAPI
()
cond
=
[[
'is_associated_people'
,
'='
,
True
]]
cond
=
[[
'is_associated_people'
,
'='
,
True
]]
...
@@ -1343,3 +1353,6 @@ class CagetteUser(models.Model):
...
@@ -1343,3 +1353,6 @@ class CagetteUser(models.Model):
pass
pass
return
answer
return
answer
from
shifts.models
import
CagetteShift
\ No newline at end of file
members/static/js/admin/manage_makeups.js
View file @
aca0b309
...
@@ -88,23 +88,17 @@ function display_makeups_members() {
...
@@ -88,23 +88,17 @@ function display_makeups_members() {
}
}
},
},
{
{
data
:
"
shift_typ
e"
,
data
:
"
makeups_to_com
e"
,
title
:
"<div class='title_center'
>Nb de point
s</div>"
,
title
:
"<div class='title_center'
title='Services de rattrapage à venir déjà choisis depuis l
\
'espace membre.'>Rattrapages à venir déjà choisi
s</div>"
,
className
:
"dt-body-center"
,
className
:
"dt-body-center"
,
width
:
"5%"
,
width
:
"8%"
,
render
:
function
(
data
,
type
,
row
)
{
render
:
function
(
data
,
type
,
full
)
{
if
(
data
==
'ftop'
)
{
return
`<b>
${
data
}
</b>`
;
return
row
.
display_ftop_points
;
}
else
if
(
data
==
'standard'
)
{
return
row
.
display_std_points
;
}
return
null
;
}
}
},
},
{
{
data
:
"makeups_to_do"
,
data
:
"makeups_to_do"
,
title
:
"<div class='title_center'
>Nb rattrapage
s</div>"
,
title
:
"<div class='title_center'
title='Rattrapages en attente de sélection sur l
\
'espace membre.'>Rattrapages pas encore choisi
s</div>"
,
className
:
"dt-body-center"
,
className
:
"dt-body-center"
,
width
:
"10%"
,
width
:
"10%"
,
render
:
function
(
data
,
type
,
full
)
{
render
:
function
(
data
,
type
,
full
)
{
...
@@ -116,6 +110,21 @@ function display_makeups_members() {
...
@@ -116,6 +110,21 @@ function display_makeups_members() {
<i class="fas fa-plus"></i>
<i class="fas fa-plus"></i>
</button>`
;
</button>`
;
}
}
},
{
data
:
"shift_type"
,
title
:
"<div class='title_center' title='Information d
\
'interprétation délicate réservée aux utilisateurs avancés.'>Points (avancé)</div>"
,
className
:
"dt-body-center"
,
width
:
"5%"
,
render
:
function
(
data
,
type
,
row
)
{
if
(
data
==
'ftop'
)
{
return
row
.
display_ftop_points
;
}
else
if
(
data
==
'standard'
)
{
return
row
.
display_std_points
;
}
return
null
;
}
}
}
],
],
aLengthMenu
:
[
aLengthMenu
:
[
...
@@ -433,7 +442,8 @@ function display_possible_members() {
...
@@ -433,7 +442,8 @@ function display_possible_members() {
makeups_to_do
:
0
,
makeups_to_do
:
0
,
shift_type
:
member
.
shift_type
,
shift_type
:
member
.
shift_type
,
display_std_points
:
member
.
display_std_points
,
display_std_points
:
member
.
display_std_points
,
display_ftop_points
:
member
.
display_ftop_points
display_ftop_points
:
member
.
display_ftop_points
,
makeups_to_come
:
member
.
makeups_to_come
});
});
let
modal_template
=
$
(
"#modal_incr_makeup_counter"
);
let
modal_template
=
$
(
"#modal_incr_makeup_counter"
);
...
...
templates/members/admin/manage_makeups.html
View file @
aca0b309
...
@@ -28,7 +28,7 @@
...
@@ -28,7 +28,7 @@
<div
class=
"page_content"
>
<div
class=
"page_content"
>
<div
id=
"table_top_area"
>
<div
id=
"table_top_area"
>
<h3>
Liste des membres
devant effectuer un rattrapag
e
</h3>
<h3>
Liste des membres
ayant au moins un rattrapage à choisir dans leur espac
e
</h3>
<div
class=
"table_grouped_action"
>
<div
class=
"table_grouped_action"
>
<button
type=
"button"
class=
"btn--primary"
id=
"decrement_selected_members_makeups"
>
<button
type=
"button"
class=
"btn--primary"
id=
"decrement_selected_members_makeups"
>
-1 rattrapage pour les membres sélectionnés
-1 rattrapage pour les membres sélectionnés
...
...
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