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
6fc24383
Commit
6fc24383
authored
Apr 12, 2022
by
Damien Moulard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bdm admin: fix pts display issue when adding makeups to member
parent
2790c99c
Pipeline
#2101
passed with stage
in 1 minute 28 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
9 deletions
+13
-9
models.py
members/models.py
+5
-0
manage_makeups.js
members/static/js/admin/manage_makeups.js
+8
-9
No files found.
members/models.py
View file @
6fc24383
...
@@ -820,6 +820,11 @@ class CagetteMember(models.Model):
...
@@ -820,6 +820,11 @@ class CagetteMember(models.Model):
members
.
append
(
m
)
members
.
append
(
m
)
return
CagetteMember
.
add_next_shifts_to_members
(
members
)
return
CagetteMember
.
add_next_shifts_to_members
(
members
)
elif
search_type
==
"makeups_data"
:
fields
=
CagetteMember
.
m_short_default_fields
fields
=
fields
+
[
'shift_type'
,
'makeups_to_do'
,
'display_ftop_points'
,
'display_std_points'
,
'shift_type'
]
return
api
.
search_read
(
'res.partner'
,
cond
,
fields
)
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'
]
fields
=
fields
+
[
'id'
,
'makeups_to_do'
,
'cooperative_state'
]
...
...
members/static/js/admin/manage_makeups.js
View file @
6fc24383
...
@@ -253,7 +253,9 @@ function update_members_makeups(member_ids, action) {
...
@@ -253,7 +253,9 @@ function update_members_makeups(member_ids, action) {
data
.
push
({
data
.
push
({
member_id
:
mid
,
member_id
:
mid
,
target_makeups_nb
:
makeups_members
[
member_index
].
makeups_to_do
,
target_makeups_nb
:
makeups_members
[
member_index
].
makeups_to_do
,
member_shift_type
:
makeups_members
[
member_index
].
shift_type
member_shift_type
:
makeups_members
[
member_index
].
shift_type
,
display_ftop_points
:
makeups_members
[
member_index
].
display_ftop_points
,
display_std_points
:
makeups_members
[
member_index
].
display_std_points
});
});
}
}
...
@@ -324,7 +326,9 @@ function display_possible_members() {
...
@@ -324,7 +326,9 @@ function display_possible_members() {
id
:
member
.
id
,
id
:
member
.
id
,
name
:
member
.
name
,
name
:
member
.
name
,
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_ftop_points
:
member
.
display_ftop_points
});
});
openModal
(
openModal
(
...
@@ -375,16 +379,11 @@ $(document).ready(function() {
...
@@ -375,16 +379,11 @@ $(document).ready(function() {
let
search_str
=
$
(
'#search_member_input'
).
val
();
let
search_str
=
$
(
'#search_member_input'
).
val
();
$
.
ajax
({
$
.
ajax
({
url
:
'/members/search/'
+
search_str
,
url
:
'/members/search/'
+
search_str
+
'?search_type=makeups_data'
,
dataType
:
'json'
,
dataType
:
'json'
,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
members_search_results
=
[];
members_search_results
=
[];
members_search_results
=
data
.
res
;
for
(
member
of
data
.
res
)
{
if
(
member
.
is_member
||
member
.
is_associated_people
)
{
members_search_results
.
push
(
member
);
}
}
display_possible_members
();
display_possible_members
();
},
},
...
...
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