17 lines
933 B
YAML
17 lines
933 B
YAML
-
|
|
In order to test the PDF reports defined on a Purchase Order, I print a Request Quotation report
|
|
-
|
|
!python {model: purchase.order}: |
|
|
import netsvc, tools, os
|
|
(data, format) = netsvc.LocalService('report.purchase.quotation').create(cr, uid, [ref('purchase.purchase_order_1'),ref('purchase.purchase_order_2')], {}, {})
|
|
if tools.config['test_report_directory']:
|
|
file(os.path.join(tools.config['test_report_directory'], 'purchase-request_quotation'+format), 'wb+').write(data)
|
|
-
|
|
I print Purchase Order report
|
|
-
|
|
!python {model: purchase.order}: |
|
|
import netsvc, tools, os
|
|
(data, format) = netsvc.LocalService('report.purchase.order').create(cr, uid, [ref('purchase.purchase_order_1'),ref('purchase.purchase_order_2')], {}, {})
|
|
if tools.config['test_report_directory']:
|
|
file(os.path.join(tools.config['test_report_directory'], 'purchase-purchase_order_report'+format), 'wb+').write(data)
|