2010-09-15 15:04:37 +00:00
|
|
|
-
|
2011-10-20 07:22:25 +00:00
|
|
|
In order to test the PDF reports defined on a Purchase Order, I print a Request Quotation report
|
2011-10-11 05:30:59 +00:00
|
|
|
-
|
2010-09-15 15:04:37 +00:00
|
|
|
!python {model: purchase.order}: |
|
|
|
|
import netsvc, tools, os
|
2012-07-11 17:07:58 +00:00
|
|
|
(data, format) = netsvc.LocalService('report.purchase.quotation').create(cr, uid, [ref('purchase.purchase_order_1'),ref('purchase.purchase_order_2')], {}, {})
|
2010-09-15 15:04:37 +00:00
|
|
|
if tools.config['test_report_directory']:
|
|
|
|
file(os.path.join(tools.config['test_report_directory'], 'purchase-request_quotation'+format), 'wb+').write(data)
|
2010-09-17 07:22:11 +00:00
|
|
|
-
|
2011-10-20 07:22:25 +00:00
|
|
|
I print Purchase Order report
|
2011-10-11 05:30:59 +00:00
|
|
|
-
|
2010-09-17 07:22:11 +00:00
|
|
|
!python {model: purchase.order}: |
|
|
|
|
import netsvc, tools, os
|
2012-07-11 17:07:58 +00:00
|
|
|
(data, format) = netsvc.LocalService('report.purchase.order').create(cr, uid, [ref('purchase.purchase_order_1'),ref('purchase.purchase_order_2')], {}, {})
|
2010-09-17 07:22:11 +00:00
|
|
|
if tools.config['test_report_directory']:
|
2011-10-11 05:30:59 +00:00
|
|
|
file(os.path.join(tools.config['test_report_directory'], 'purchase-purchase_order_report'+format), 'wb+').write(data)
|