Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
  • Create a report for the Session model in Odoo9

    • 0
    • 1
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 433
    Comment on it

    If you want to create a report for the Session mode follow the below code in your Odoo module. And for each session, it should display session's name, its start and end, and list the session's attendees.

        # only loaded in demonstration mode
        'demo': [
        <report id="report_session" model="openacademy.session" string="Session Report" name="openacademy.report_session_view" file="openacademy.report_session" report_type="qweb-pdf">
    <template id="report_session_view">
        <t t-call="report.html_container">
            <t t-foreach="docs" t-as="doc">
                <t t-call="report.external_layout">
                    <div class="page">
                        <h2 t-field=""/>
                        <p>From <span t-field="doc.start_date"/> to <span t-field="doc.end_date"/></p>
                            <t t-foreach="doc.attendee_ids" t-as="attendee">
                                <li><span t-field=""/></li>

    Note- If you noticed that the PDF report is missing the styles means the text appears but the style/layout is different from the html version, then it is possible that your wkhtmltopdf process couldn't reach to the web server to download them.

 0 Comment(s)

Sign In

Sign up using

Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: