Commit 39e18e62 by Yvon

give explanation when you add or delete makeup and display it point movements screen in odoo

parent 71e4b8bb
Pipeline #2422 passed with stage
in 1 minute 25 seconds
...@@ -400,7 +400,7 @@ def update_members_makeups(request): ...@@ -400,7 +400,7 @@ def update_members_makeups(request):
points_update = points_diff points_update = points_diff
data = { data = {
'name': "Modif manuelle des rattrapages depuis l'admin BDM", 'name': "Admin BDM - " + member_data["description"],
'shift_id': False, 'shift_id': False,
'type': member_data["member_shift_type"], 'type': member_data["member_shift_type"],
'partner_id': int(member_data["member_id"]), 'partner_id': int(member_data["member_id"]),
......
...@@ -151,9 +151,15 @@ function display_makeups_members() { ...@@ -151,9 +151,15 @@ function display_makeups_members() {
const member = makeups_members.find(m => m.id == member_id); const member = makeups_members.find(m => m.id == member_id);
openModal( openModal(
`Enlever un rattrapage à ${member.name} ?`, `Enlever un rattrapage à ${member.name} ?
<br><br><label>Explication : </label><input class="" type="text" id="decr-explanation">
<br><br><label>Signature : </label><input class="" type="text" id="decr-signature">`,
() => { () => {
update_members_makeups([member_id], "decrement"); update_members_makeups(
[member_id],
"decrement",
$("#decr-signature")[0].value + ' : ' + $("#decr-explanation")[0].value
);
}, },
"Confirmer", "Confirmer",
false false
...@@ -168,9 +174,15 @@ function display_makeups_members() { ...@@ -168,9 +174,15 @@ function display_makeups_members() {
const member = makeups_members.find(m => m.id == member_id); const member = makeups_members.find(m => m.id == member_id);
openModal( openModal(
`Ajouter un rattrapage à ${member.name} ?`, `Ajouter un rattrapage à ${member.name} ?
<br><br><label>Explication : </label><input class="" type="text" id="incr-explanation">
<br><br><label>Signature : </label><input class="" type="text" id="incr-signature">`,
() => { () => {
update_members_makeups([member_id], "increment"); update_members_makeups(
[member_id],
"increment",
$("#incr-signature")[0].value + ' : ' + $("#incr-explanation")[0].value
);
}, },
"Confirmer", "Confirmer",
false false
...@@ -198,9 +210,15 @@ function display_makeups_members() { ...@@ -198,9 +210,15 @@ function display_makeups_members() {
if (first_select) { if (first_select) {
$("#decrement_selected_members_makeups").on("click", () => { $("#decrement_selected_members_makeups").on("click", () => {
openModal( openModal(
`Enlever un rattrapage aux membres sélectionnés ?`, `Enlever un rattrapage aux membres sélectionnés ?
<br><br><label>Explication : </label><input class="" type="text" id="decr-explanation">
<br><br><label>Signature : </label><input class="" type="text" id="decr-signature">`,
() => { () => {
update_members_makeups(selected_rows, "decrement"); update_members_makeups(
selected_rows,
"decrement",
$("#decr-signature")[0].value + ' : ' + $("#decr-explanation")[0].value
);
}, },
"Confirmer", "Confirmer",
false false
...@@ -220,7 +238,7 @@ function display_makeups_members() { ...@@ -220,7 +238,7 @@ function display_makeups_members() {
* @param {Array} member_ids * @param {Array} member_ids
* @param {String} action increment | decrement * @param {String} action increment | decrement
*/ */
function update_members_makeups(member_ids, action) { function update_members_makeups(member_ids, action, description) {
openModal(); openModal();
data = []; data = [];
...@@ -255,7 +273,8 @@ function update_members_makeups(member_ids, action) { ...@@ -255,7 +273,8 @@ function update_members_makeups(member_ids, action) {
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_ftop_points: makeups_members[member_index].display_ftop_points,
display_std_points: makeups_members[member_index].display_std_points display_std_points: makeups_members[member_index].display_std_points,
description: description,
}); });
} }
...@@ -332,9 +351,15 @@ function display_possible_members() { ...@@ -332,9 +351,15 @@ function display_possible_members() {
}); });
openModal( openModal(
`Ajouter un rattrapage à ${member.name} ?`, `Ajouter un rattrapage à ${member.name} ?
<br><br><label>Explication : </label><input class="" type="text" id="incr-explanation">
<br><br><label>Signature : </label><input class="" type="text" id="incr-signature">`,
() => { () => {
update_members_makeups([member.id], "increment"); update_members_makeups(
[member.id],
"increment",
$("#incr-signature")[0].value + ' : ' + $("#incr-explanation")[0].value
);
members_search_results = []; members_search_results = [];
$('#search_member_input').val(''); $('#search_member_input').val('');
$('.search_member_results_area').hide(); $('.search_member_results_area').hide();
......
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