i need to add a report to the print button inside form view instead of the one in header .. any help
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
Hi Layal,
You can add a button in the form view and associate a method in the same object. Then the method should return something that triggers the report.
Example of printing a webkit report:
def print_check(self, cr, uid, ids, context=None):
if not ids:
return {}
return {
'type': 'ir.actions.report.xml',
'report_name':'account.check.print',
'datas': {
'model':'account.voucher',
'id': ids and ids[0] or False,
'ids': ids and ids or [],
'report_type': 'webkit'
},
'nodestroy': True
}
Add the button like this in the xml file of the view,
<button name="print_check" string="Print check" type="object" icon="gtk-execute"/>
Please note that the return style will vary based on the type of report you want to print. Because we have reports like webkit report, aerro report, rml report and jasper report
Thanks
Thank you Vivekrajan ,its on the way to work ! but my report is of rml type .. i wrote 'report_type': 'rml' as u mentioned but i got "openerp warning : unknown report type :rml"..please may u guide me please .
There is no need to write key of 'report_type'.
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
3
thg 7 22
|
11456 | ||
|
7
thg 3 22
|
41713 | ||
|
1
thg 10 22
|
5649 | ||
|
6
thg 4 20
|
11235 | ||
|
2
thg 3 15
|
7532 |