Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odgovori
2415 Prikazi

I have written an own module for my reports in Odoo 8.

addons/my_reports/my_reports_report.xml

<report
    id="my_report_saleorder"
    string="My Offers"
    model="sale.order"
    report_type="qweb-pdf"
    name="my_reports.my_reports_saleorder"
    file="my_reports.my_reports_saleorder"
    attachment_use="True"
    attachment="'Angebot-ausgehend_'
 + (object.name or '').replace('/','_')
 + '_'
 + (object.partner_id.name or '').replace('/', '_').replace(' ', '-')
 + (object.state == 'draft' and '_draft' or '')
 + '.pdf'"
/>

addons/my_reports/views/my_reports_saleorder.xml

<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<template id="my_reports_saleorder_document">
        ... many report related stuff ...
</template>
<template id="my_reports_saleorder">
    <t t-call="report.html_container">
        <t t-foreach="doc_ids" t-as="doc_id">
            <t t-raw="translate_doc(doc_id, doc_model, 'partner_id.lang', 'my_reports.my_reports_saleorder_document')"/>
        </t>
    </t>
</template>
</data>
</openerp>

It is attached automatically to the print menu dropbox of the sale_order form.

If I print my report it will be automatically attached to the form. But it is not attached as 1 document. It will be attached multiple documents. One document for every page in the report. (I have installed 'Document Management System 2.1'.)

My invoice report works correctly.

Has any body an idea?

Avatar
Opusti
Avtor Best Answer

Was my English to bad or are the questions to difficult?

Avatar
Opusti
Related Posts Odgovori Prikazi Aktivnost
1
jul. 25
2001
1
maj 25
2153
1
apr. 25
2512
1
feb. 25
1791
0
okt. 24
1524