Commit 6fc24383 by Damien Moulard

bdm admin: fix pts display issue when adding makeups to member

parent 2790c99c
Pipeline #2101 passed with stage
in 1 minute 28 seconds
...@@ -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']
......
...@@ -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();
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment