Commit 66e5be54 by Félicie

fix bugs

parent c86826f8
Pipeline #2115 passed with stage
in 1 minute 34 seconds
...@@ -556,8 +556,10 @@ def get_member_info(request, id): ...@@ -556,8 +556,10 @@ def get_member_info(request, id):
member = member[0] member = member[0]
parent = None parent = None
if member['parent_id']: if member['parent_id']:
parent = api.search_read('res.partner', [['id', '=', int(member['parent_id'][0])]], ['barcode_base'])[0] parent_barcode_base = api.search_read('res.partner', [['id', '=', int(member['parent_id'][0])]], ['barcode_base'])[0]
member['parent_barcode_base'] = parent['barcode_base'] member['parent_barcode_base'] = parent_barcode_base['barcode_base']
parent_email = api.search_read('res.partner', [['id', '=', int(member['parent_id'][0])]], ['email'])[0]
member['parent_email'] = parent_email['email']
res['member'] = member res['member'] = member
response = JsonResponse(res) response = JsonResponse(res)
else: else:
......
...@@ -4,6 +4,9 @@ var childId = null; ...@@ -4,6 +4,9 @@ var childId = null;
var parentName = null; var parentName = null;
var childName = null; var childName = null;
var parentEmail = null;
var childEmail = null;
const possible_cooperative_state = { const possible_cooperative_state = {
suspended: "Rattrapage", suspended: "Rattrapage",
exempted: "Exempté.e", exempted: "Exempté.e",
...@@ -440,10 +443,10 @@ $(document).ready(function() { ...@@ -440,10 +443,10 @@ $(document).ready(function() {
traditional: true, traditional: true,
contentType: "application/json; charset=utf-8", contentType: "application/json; charset=utf-8",
success: function(data) { success: function(data) {
parentName = data.member.parent_barcode_base + ' - ' + data.member.parent_name parentName = data.member.parent_barcode_base + ' - ' + data.member.parent_name;
parentEmail = data.member.email parentEmail = data.member.parent_email;
childName = data.member.barcode_base + ' - ' + data.member.name childName = data.member.barcode_base + ' - ' + data.member.name;
childEmail = data.member.email childEmail = data.member.email;
confirmDeletion(childId); confirmDeletion(childId);
}, },
error: function(data) { error: function(data) {
......
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