I would like to run a pentaho report from a button within a form view (openERP 7.0). Are there any examples out there of this so I can get an idea of what steps should be taken? i.e. what actions should be created and what should be placed in the xml and py files.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- ลูกค้าสัมพันธ์
- e-Commerce
- ระบบบัญชี
- สินค้าคงคลัง
- PoS
- Project
- MRP
คำถามนี้ถูกตั้งค่าสถานะ
In your XML View definition put:
<button name=print_report" string="Print" type="object">
In your class definition add a new method:
def print_report(self, cr, uid, ids, context=None):
return { 'type': 'ir.actions.report.xml', 'report_name': 'my.report.name',
'nodestroy' : True
}
Your report action XML should be like:
<record id="my_report" model="ir.actions.report.xml"> <field name="name">my report name</field> <field name="report_name">my.report.name</field> <field name="model">report.model</field> <field name="auto" eval="False"/>
<field name="is_pentaho_report" eval="True"/> <field name="pentaho_report_model_id" ref="module.model_report_model"/> <field name="pentaho_report_output_type">pdf</field> <field name="pentaho_filename">module/report/my_report.prpt</field> <field name="pentaho_load_file" eval="True"/> </record
Button @name and print method should have the same name
Also report_name should be the same in method and report action XML
Be very careful setting pentaho_report_model_id. Format is: module name with no spaces + ".model_" + report model with dots converted to underscores
This worked for me fine. Once minor amendment to the xml view -
สนุกกับการพูดคุยนี้ใช่ไหม? เข้าร่วมเลย!
สร้างบัญชีวันนี้เพื่อเพลิดเพลินไปกับฟีเจอร์พิเศษและมีส่วนร่วมกับคอมมูนิตี้ที่ยอดเยี่ยมของเรา!
ลงชื่อRelated Posts | ตอบกลับ | มุมมอง | กิจกรรม | |
---|---|---|---|---|
Call a report from a button
แก้ไขแล้ว
|
|
2
เม.ย. 16
|
11200 | |
|
0
มี.ค. 15
|
3678 | ||
|
0
มี.ค. 15
|
3331 | ||
how to print a custom report in openerp
แก้ไขแล้ว
|
|
1
ต.ค. 22
|
5880 | |
|
0
ก.ย. 15
|
5956 |