Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to make report template in Odoo ?

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 162
    Comment on it

    There are some specific variables accessible to make template reports.
    1. docs : records for the current report
    2. doc_ids : list of ids for the docs records
    3. doc_model : model for the docs records
    4. time : a reference to time from the Python standard library
    5. user : res.user record for the user printing the report
    6. res_company : record for the current user's company
    For example see below code

      <template id="report_invoice">
            <t t-call="report.html_container">
                <t t-foreach="docs" t-as="o">
                    <t t-call="report.external_layout">
                        <div class="page">
                            <h2>Report title</h2>
                            This object's name is <span t-field="o.name"></span>
                        </div>
                    </t>
                </t>
            </t>
    
    </template>
    

    Note- If you wish to access other records/models in the template, you will need a custom report.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
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: