Commit f0bb71ec by Damien Moulard

fix server & interface errors

parent 01718d62
Pipeline #2123 passed with stage
in 1 minute 39 seconds
......@@ -556,9 +556,11 @@ def get_member_info(request, id):
member = member[0]
parent = None
if member['parent_id']:
parent = api.search_read('res.partner', [['id', '=', int(member['parent_id'][0])]], ['barcode_base', 'email'])[0]
member['parent_barcode_base'] = parent['barcode_base']
member['parent_email'] = parent['email']
res_parent = api.search_read('res.partner', [['id', '=', int(member['parent_id'][0])]], ['barcode_base', 'email'])
if res_parent:
parent = res_parent[0]
member['parent_barcode_base'] = parent['barcode_base']
member['parent_email'] = parent['email']
res['member'] = member
response = JsonResponse(res)
else:
......
......@@ -118,5 +118,19 @@
}
/* Modale */
.attached-members .member div {width: 50px; display: inline-block;}
.attached-members .member div.name {width: 80%;}
\ No newline at end of file
.attached-members .member div {width: 50px; display: inline-block; margin: 1rem 0;}
.attached-members .member div.name {width: 100%; position: relative;}
.attached-members .member div.select_after_unattached_state {
position: absolute;
right:5rem;
top:0;
bottom:0;
margin: 0;
display:flex;
justify-content: center ;
align-items: center;
}
.attached-members .member .after_unattached_state {
cursor: pointer;
}
\ No newline at end of file
......@@ -239,9 +239,15 @@ function confirmDeletion(childId) {
var modalContent = $('#confirmModal');
modalContent.find("#parentName").text(parentName);
modalContent.find("#parentEmail").text(parentEmail)
modalContent.find("#childName").text(childName);
modalContent.find("#childEmail").text(childEmail)
if (parentEmail != false) {
modalContent.find("#parentEmail").text(parentEmail)
}
if (childEmail != false) {
modalContent.find("#childEmail").text(childEmail)
}
modalContent = modalContent.html();
openModal(modalContent, () => {
if (is_time_to('delete_pair')) {
......@@ -443,7 +449,11 @@ $(document).ready(function() {
traditional: true,
contentType: "application/json; charset=utf-8",
success: function(data) {
parentName = data.member.parent_barcode_base + ' - ' + data.member.parent_name;
if (data.member.parent_barcode_base !== undefined) {
parentName = data.member.parent_barcode_base + ' - ' + data.member.parent_name;
} else {
parentName = data.member.parent_name;
}
parentEmail = data.member.parent_email;
childName = data.member.barcode_base + ' - ' + data.member.name;
childEmail = data.member.email;
......
......@@ -26,16 +26,20 @@
<div class="name">
<strong><span id="parentName"></span></strong> (titulaire)<br />
<i><span id="parentEmail"></span></i>
<div class="select_after_unattached_state">
<input type="checkbox" name="parent_gone" class="after_unattached_state" />
</div>
</div>
<div><input type="checkbox" name="parent_gone" class="after_unattached_state" /></div>
</div>
avec
<div class="member">
<div class="name">
<strong><span id="childName"></span></strong><br />
<i><span id="childEmail"></span></i>
<div class="select_after_unattached_state">
<input type="checkbox" name="child_gone" class="after_unattached_state" />
</div>
</div>
<div><input type="checkbox" name="child_gone" class="after_unattached_state" /></div>
</div>
</div>
</div>
......
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