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
5cd5e736
Commit
5cd5e736
authored
Mar 08, 2022
by
Félicie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
deleted function
parent
415927be
Pipeline
#1883
failed with stage
in 1 minute 25 seconds
Changes
7
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
140 additions
and
27 deletions
+140
-27
admin.py
members/admin.py
+10
-1
models.py
members/models.py
+8
-0
manage_attached.css
members/static/css/admin/manage_attached.css
+10
-0
manage_attached.js
members/static/js/admin/manage_attached.js
+103
-1
urls.py
members/urls.py
+1
-0
manage_attached_create_pair.html
templates/members/admin/manage_attached_create_pair.html
+3
-9
manage_attached_delete_pair.html
templates/members/admin/manage_attached_delete_pair.html
+5
-16
No files found.
members/admin.py
View file @
5cd5e736
...
...
@@ -339,6 +339,11 @@ def get_makeups_members(request):
res
=
CagetteMembers
.
get_makeups_members
()
return
JsonResponse
({
'res'
:
res
})
def
get_attached_members
(
request
):
""" Récupération des membres en binôme """
res
=
CagetteMembers
.
get_attached_members
()
return
JsonResponse
({
'res'
:
res
})
def
update_members_makeups
(
request
):
""" Met à jour les rattrapages des membres passés dans la requête """
res
=
{}
...
...
@@ -431,7 +436,6 @@ def get_member_info(request,coop_id):
'parent_id'
,
'is_associated_people'
,
'parent_name'
,
'barcode_base'
,
"makeups_to_do"
]
member
=
api
.
search_read
(
'res.partner'
,
[[
'barcode_base'
,
'='
,
coop_id
]],
fields
)
...
...
@@ -551,3 +555,8 @@ def delete_pair(request):
return
response
else
:
return
JsonResponse
({
"message"
:
"Method Not Allowed"
},
status
=
405
)
def
get_attached_members
(
request
):
""" Récupération des membres qui doivent faire des rattrapages """
res
=
CagetteMembers
.
get_attached_members
()
return
JsonResponse
({
'res'
:
res
})
members/models.py
View file @
5cd5e736
...
...
@@ -1093,6 +1093,14 @@ class CagetteMembers(models.Model):
res
=
api
.
search_read
(
'res.partner'
,
cond
,
fields
)
return
res
@staticmethod
def
get_attached_members
():
api
=
OdooAPI
()
cond
=
[[
'is_associated_people'
,
'='
,
True
]]
fields
=
[
'id'
,
'name'
,
'parent_name'
]
res
=
api
.
search_read
(
'res.partner'
,
cond
,
fields
)
return
res
class
CagetteServices
(
models
.
Model
):
"""Class to handle cagette Odoo services."""
...
...
members/static/css/admin/manage_attached.css
View file @
5cd5e736
...
...
@@ -72,6 +72,16 @@
margin
:
1rem
;
}
/* Attached members table */
.table_area
{
margin-top
:
20px
;
}
#table_top_area
{
display
:
flex
;
justify-content
:
space-between
;
}
/* -- Tiles */
.tiles_container
{
...
...
members/static/js/admin/manage_attached.js
View file @
5cd5e736
...
...
@@ -52,7 +52,6 @@ function ready_for_submission() {
}
}
/**
* Display member info
*/
...
...
@@ -73,7 +72,110 @@ function display_member_infos(divId, memberData) {
}
}
/**
* Load attached members
*/
function
load_attached_members
()
{
console
.
log
(
get_attached_members
)
$
.
ajax
({
type
:
'GET'
,
url
:
"/members/get_attached_members"
,
dataType
:
"json"
,
traditional
:
true
,
contentType
:
"application/json; charset=utf-8"
,
success
:
function
(
data
)
{
attached_members
=
data
.
res
;
display_attached_members
();
},
error
:
function
(
data
)
{
err
=
{
msg
:
"erreur serveur lors de la récupération des membres avec rattrapage"
,
ctx
:
'load_makeups_members'
};
if
(
typeof
data
.
responseJSON
!=
'undefined'
&&
typeof
data
.
responseJSON
.
error
!=
'undefined'
)
{
err
.
msg
+=
' : '
+
data
.
responseJSON
.
error
;
}
report_JS_error
(
err
,
'orders'
);
closeModal
();
alert
(
'Erreur serveur lors de la récupération des membres avec rattrapage. Ré-essayez plus tard.'
);
}
});
}
/**
* Display table of attached members
*/
function
display_attached_members
()
{
if
(
attached_members_table
)
{
$
(
'#attached_members_table'
).
off
();
attached_members_table
.
clear
().
destroy
();
$
(
'#attached_members_table'
).
empty
();
}
attached_members_table
=
$
(
'#attached_members_table'
).
DataTable
({
data
:
attached_members
,
columns
:
[
{
data
:
"id"
,
title
:
''
,
className
:
"dt-body-center"
,
orderable
:
false
,
render
:
function
(
data
)
{
return
`<input type="checkbox" class="select_member_cb" id="select_member_
${
data
}
" value="
${
data
}
">`
;
},
width
:
"3%"
},
{
data
:
"parent_name"
,
title
:
"Nom du titulaire"
},
{
data
:
"name"
,
title
:
"en binôme avec"
,
}
],
aLengthMenu
:
[
[
25
,
50
,
-
1
],
[
25
,
50
,
"Tout"
]
],
iDisplayLength
:
25
,
oLanguage
:
{
"sProcessing"
:
"Traitement en cours..."
,
"sSearch"
:
"Rechercher dans le tableau"
,
"sLengthMenu"
:
"Afficher _MENU_ éléments"
,
"sInfo"
:
"Affichage de l'élément _START_ à _END_ sur _TOTAL_ éléments"
,
"sInfoEmpty"
:
"Affichage de l'élément 0 à 0 sur 0 élément"
,
"sInfoFiltered"
:
"(filtré de _MAX_ éléments au total)"
,
"sInfoPostFix"
:
""
,
"sLoadingRecords"
:
"Chargement en cours..."
,
"sZeroRecords"
:
"Aucun élément à afficher"
,
"sEmptyTable"
:
"Aucune donnée disponible dans le tableau"
,
"oPaginate"
:
{
"sFirst"
:
"Premier"
,
"sPrevious"
:
"Précédent"
,
"sNext"
:
"Suivant"
,
"sLast"
:
"Dernier"
},
"oAria"
:
{
"sSortAscending"
:
": activer pour trier la colonne par ordre croissant"
,
"sSortDescending"
:
": activer pour trier la colonne par ordre décroissant"
},
"select"
:
{
"rows"
:
{
"_"
:
"%d lignes séléctionnées"
,
"0"
:
"Aucune ligne séléctionnée"
,
"1"
:
"1 ligne séléctionnée"
}
}
}
});
}
$
(
document
).
ready
(
function
()
{
...
...
members/urls.py
View file @
5cd5e736
...
...
@@ -64,4 +64,5 @@ urlpatterns = [
url
(
r'^update_members_makeups$'
,
admin
.
update_members_makeups
),
url
(
r'^delete_shift_registration$'
,
admin
.
delete_shift_registration
),
url
(
r'^get_member_info/(\d+)$'
,
admin
.
get_member_info
),
url
(
r'^get_attached_members$'
,
admin
.
get_attached_members
),
]
templates/members/admin/manage_attached_create_pair.html
View file @
5cd5e736
...
...
@@ -60,13 +60,9 @@
</div>
</div>
<div
class=
"create_pair_button"
>
<button
id=
"createPair"
type=
"button"
name=
"button"
disabled
>
Créer le binôme
</button>
</div>
<div
class=
"create_pair_button"
>
<button
id=
"createPair"
type=
"button"
name=
"button"
disabled
>
Créer le binôme
</button>
</div>
<div
class=
"tile"
>
<div
class=
"search_member_form_area"
id=
"search_member_form_area"
>
<h4>
Rechercher le.a coopérateur.ice suppléant.e
</h4>
...
...
@@ -98,8 +94,6 @@
<span
class=
"member_associated_partner member_info"
></span>
</div>
</div>
</div>
</div>
</div>
</div>
...
...
templates/members/admin/manage_attached_delete_pair.html
View file @
5cd5e736
...
...
@@ -27,23 +27,12 @@
<div
class=
"page_content"
>
<div
id=
"search_member_area"
>
<div
id=
"search_member_form_area"
>
<h4>
Rechercher le.a coopérateur.ice attaché.e au binôme
</h4>
<form
id=
"search_member_form"
action=
"javascript:;"
method=
"post"
>
<input
type=
"text"
id=
"search_member_input"
value=
""
placeholder=
"Nom ou numéro du coop..."
required
>
<button
type=
"submit"
class=
"btn--primary"
id=
"search_member_button"
>
Recherche
</button>
</form>
</div>
</div>
<div
class=
"search_member_results_area"
style=
"display:none;"
>
<div
class=
"search_results_text"
>
<p><i>
Choisissez parmi les membres trouvés :
</i></p>
</div>
<div
class=
"search_member_results"
></div>
</div>
<div
id=
"subheader"
>
<h4>
Liste des membres en binômes
</h4>
</div>
<div
class=
"table_area"
>
<table
id=
"attached_members_table"
class=
"display"
cellspacing=
"0"
width=
"100%"
></table>
</div>
</div>
</div>
...
...
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