Hey i am preparing an attendance view in portal, i am currently able to display the record in the portal and when i click on href it calls the other template but that template is empty. I think its unable to fetch the id of the record or i dont know. Kindly help. Here is my code
.py
class AttendControl(http.Controller):
@http.route('/my_attend_detail',type='http',auth='public',website=True)
def attend_detail(self, **kwargs):
attend_detail = http.request.env['op.attendance.sheet'].sudo().search([])
return request.render('attendance_website.attend_detail_temp',{'my_attend':attend_detail})
@http.route('/attendance_line/<int:order_id>', type='http', auth='public', website=True)
def this_attend_detail(self,**kwargs):
order = http.request.env['op.attendance.sheet'].sudo().search([])
return request.render('attendance_website.my_attendance_lines', {'order': order})
@http.route('/attendance_line/<int:order_id>', type='http', auth='public', website=True)
def that_attend_rights(self, new_attend_detail=None):
order = http.request.env['op.attendance.sheet'].browse()
return request.render('attendance_website.my_attendance_lines', {'order': order})
.xml
This is href line of code for moving to the new template
<a t-attf-href="/attendance_line/{{order.id}}?{{keep_query()}}">
Here is the template
<template id="my_attendance_lines" name="Attendance">
<t t-call="website.layout">
<div class="oe_structure">
<div class="container">
<br/>
<center>
<h3>Mark Attendance</h3>
</center>
<br/>
<table class="table-striped table">
<thead style="font-size: 23px;" string="Students">
<tr>
<h6>
<b>
<th>Students</th>
<th>Present?</th>
<th>Remark</th>
</b>
</h6>
</tr>
</thead>
<tbody>
<t t-foreach="order" t-as="orders">
<tr>
<td>
<span t-esc="orders.student_id"/>
</td>
<td>
<span t-esc="orders.present"/>
</td>
<td>
<span t-esc="orders.remark"/>
</td>
</tr>
</t>
</tbody>
</table>
</div>
</div>
</t>
</template>
Kindly help! thanks in advance
This is what i get in the log message
2020-02-12 06:01:08,770 15926 INFO odoo13 odoo.http: <function odoo.addons.attendance_website.controllers.my_cont.that_attend_rights> called ignoring args <order_id=62>