Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
7733 Widoki

I'm trying to make my own custom report for the equipment.

I've created the report:
https://i.imgur.com/LAj12ef.png

And made a template:
https://i.imgur.com/W9s8QZM.png

I also performed an export on this template to get external ID like this:
https://www.youtube.com/watch?v=feZ64VGJCpk

And edited it the Model Data like this:
https://i.imgur.com/h7F2wum.png

But now when I'm trying to print the report I get this error:
​https://pastebin.com/6TnE9FA2

What is wrong?

EDIT:
It turned out that the problem is with example template from Odoo documentation:
https://www.odoo.com/documentation/12.0/reference/reports.html​

When I changed it to something like this:

<?xml version="1.0"?>
<t t-name="web.equipment_report">
<t t-call="web.html_container">
<t t-set="o" t-value="res_company"/>
<t t-call="web.external_layout">
<div class="page">
<p>This is a sample of an external report.</p>
</div>
</t>
</t>
</t>

It is now somewhat working.

Awatar
Odrzuć
Najlepsza odpowiedź

Try like this:

Report template:

<odoo>

<?xml version="1.0"?>
<template id="equipment_report_documents">
<t t-call="web.external_layout_standard">
<div class="page">
<p>This is a sample of an external report.</p>
</div>
</t>
</template>

<template id="web.equipment_report">
<t t-call="web.html_container">
<t t-foreach="docs" t-as="o">
<t t-call="web.equipment_report_documents" />
</t>
</t>
</template>
</odoo>

Note: Template id(equipment_report) should match with report action name. For eg.

Report action:

<report id="any_name" model="name_of_the_model"
string="Name to show in print option" report_type="qweb-pdf"
name="web.equipment_report" file="web.equipment_report"
paperformat="base.paperformat_us" />

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
cze 20
2536
1
lip 24
1352
3
gru 20
3064
2
wrz 20
3303
1
lut 20
3079