[MERGE] from trunk
[odoo/odoo.git] / addons / delivery / test / delivery_report.yml
1
2 -
3  
4   In Order to test the delivery report I create picking with move lines.
5
6   !record {model: stock.picking, id: stock_picking_delivery}:
7     name: test_picking
8     origin: SO001
9     address_id: base.res_partner_address_4
10     company_id: base.main_company
11     date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
12     invoice_state: none
13     move_lines:
14       - company_id: base.main_company
15         date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
16         location_dest_id: stock.stock_location_customers
17         location_id: stock.stock_location_stock
18         name: HP CD writers
19         product_id: product.product_product_pc1
20         product_qty: 3.0
21         product_uom: product.product_uom_unit
22         date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
23         product_uos_qty: 3.0
24     move_type: direct
25     type: out
26     
27     
28
29 -
30   In order to test the PDF reports defined on a Delievry, we will print a Delivery Order report
31
32   !python {model: stock.picking}: |
33     import netsvc, tools, os
34     (data, format) = netsvc.LocalService('report.sale.shipping').create(cr, uid, [ref('stock_picking_delivery')], {}, {})
35     if tools.config['test_report_directory']:
36         file(os.path.join(tools.config['test_report_directory'], 'delievry-shipping'+format), 'wb+').write(data)