Skip to Content
Menu
This question has been flagged
2 Replies
3103 Views

I make 2 differents report from to 2 models but I need that one of them is page 2 of the other. How can I do it ?

I try with t-call inside the first one but odoo can find it maybe I don't manipulate in the right way...

<t t-foreach="docs" t-as="o">
              <t t-foreach="o.programme_ids" t-as="p">
                  <t t-call="report_programme_document">
                  </t>
              </t>
</t>
Avatar
Discard
Best Answer

HI sylvie,

To add a another report to next page of a report you can do it as follows, Here i added the report of sale order to a custom report in sales, so in the second page of custom report i got the sales quotation report. Hope this will help you

Thank You

<template id="report_kitchen">
<t t-call="report.html_container">
<t t-foreach="docs" t-as="doc">
<t t-call="kitchen_order_print.report_kitchen_print" t-lang="doc.partner_id.lang"/>
        <t t-call="sale.report_saleorder_document" t-lang="doc.partner_id.lang"/>
</t>
</t>
</template>
Avatar
Discard
Author Best Answer

Thank you, it doesn't work yet but I think it's because the report_programme_document come from a Many2many in report_convention_document. I try to do foreach but that not working yet it makes error on the attribut of the report_programme_document :

<template id="report_custom_document">
          <t t-call="report.html_container">
          <t t-foreach="docs" t-as="doc">
              <t t-call="myBeeFormation.report_convention_document" />
              <t t-foreach="doc.programme_ids" t-as="pro">
              <t t-call="myBeeFormation.report_programme_document" />
              </t>
          </t>
          </t>
      </template>
Avatar
Discard

Hi , it worked correctly for me. Still you getting the error ?

Author

I still getting the error:

Error to render compiling AST

KeyError: 'description'

Template: myBeeFormation.report_programme_document

Path: /templates/t/t/t/t/div/ul/li[1]/span

Node: Error to render compiling AST

KeyError: 'description'

Template: myBeeFormation.report_programme_document

Path: /templates/t/t/t/t/div/ul/li[1]/span

Node: <span t-field="do.description"/>

I don't understand <span t-field="do.description"/> work corretly if I ask just report_programme_document.