In odoo 8 it's possible to print a report just by defining the text of the html/qweb report and the action that starts the printing (called report action).
With just two file (and by update of the __openerp__.py ) a new item appears in the "print" dropdown menu of the UI (user interface) of odoo allowing to download the report.
To get a file filled with the content of a contract (in Sale) the files can be:
[code]
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<report
id="report_contract_pdf"
string="Quotation / Order"
model="account.analytic.account"
report_type="qweb-pdf"
file="sale.report_saleorder___ciccio"
name="contract_pdf.report_contract"
/>
</data>
</openerp>
[/code]
[code]
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<template id="report_contract_document">
<t t-call="report.external_layout">
<div class="page">
<h1>hola<h1>
</div>
</t>
</template>
<template id="report_contract">
<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', 'sale.report_contract_document')"/>
</t>
</t>
</template>
</data>
</openerp>
[/code]
My question goes with the attributes of the the report action file.
Why can't I set any report_name in the report action?
Which is the difference between these attributes: "report_name", "file", and "attachment"?
These are my answers:
- report_name: is the name of your report (which will be the name of the PDF output), the download pdf file
- file: the html name ( to see the report ad an html page at the address for instance http://<server-address>/report/pdf/sale.report_saleorder/38?) it seams not
- attachment: python expression that defines the name (which one? the download file name? but this is the report_name...) of the report
Andrea
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- إدارة علاقات العملاء
- e-Commerce
- المحاسبة
- المخزون
- PoS
- Project
- MRP
لقد تم الإبلاغ عن هذا السؤال
7263
أدوات العرض
هل أعجبك النقاش؟ لا تكن مستمعاً فقط. شاركنا!
أنشئ حساباً اليوم لتستمتع بالخصائص الحصرية، وتفاعل مع مجتمعنا الرائع!
تسجيلالمنشورات ذات الصلة | الردود | أدوات العرض | النشاط | |
---|---|---|---|---|
|
1
سبتمبر 19
|
2876 | ||
|
3
فبراير 19
|
3764 | ||
|
0
ديسمبر 15
|
3215 | ||
|
0
مارس 15
|
3944 | ||
|
0
يناير 21
|
2818 |