[MERGE] Sync with trunk, until revision 8927
[odoo/odoo.git] / addons / stock / test / stock_report.yml
1 -
2   Stock user can print all reports related to stock, so let's check data with giving the access rights of user.
3 -
4   !context
5     uid: 'res_users_stock_user'
6 -
7   I print a stock overview report of location.
8 -
9   !python {model: stock.location}: |
10     import os
11     import openerp.report
12     from openerp import tools
13     data, format = openerp.report.render_report(cr, uid, [ref('location_monitor')], 'lot.stock.overview', {}, {})
14     if tools.config['test_report_directory']:
15         file(os.path.join(tools.config['test_report_directory'], 'stock-overview'+format), 'wb+').write(data)
16 -
17   I print a Stock Overview report of location with child location.
18 -
19   !python {model: stock.location}: |
20     import os
21     import openerp.report
22     from openerp import tools
23     data, format = openerp.report.render_report(cr, uid, [ref('location_monitor')], 'lot.stock.overview_all', {}, {})
24     if tools.config['test_report_directory']:
25         file(os.path.join(tools.config['test_report_directory'], 'stock-overviewall'+format), 'wb+').write(data)
26 -
27   I print a Stock Inventory report.
28 -
29   !python {model: stock.inventory}: |
30     import os
31     import openerp.report
32     from openerp import tools
33     data, format = openerp.report.render_report(cr, uid, [ref('stock_inventory_0')], 'stock.inventory.move', {}, {})
34     if tools.config['test_report_directory']:
35         file(os.path.join(tools.config['test_report_directory'], 'stock-stock_inventory_move.'+format), 'wb+').write(data)
36 -
37   I print a outgoing shipment report.
38 -
39   !python {model: stock.picking}: |
40     import os
41     import openerp.report
42     from openerp import tools
43     data, format = openerp.report.render_report(cr, uid, [ref('outgoing_shipment')], 'stock.picking.list', {}, {})
44     if tools.config['test_report_directory']:
45         file(os.path.join(tools.config['test_report_directory'], 'stock-picking_list'+format), 'wb+').write(data)
46 -
47   I print stock Report.
48 -
49   !python {model: product.product}: |
50     import os
51     import openerp.report
52     from openerp import tools
53     data, format = openerp.report.render_report(cr, uid, [ref('product_product_6')], 'stock.product.history', {}, {})
54     if tools.config['test_report_directory']:
55         file(os.path.join(tools.config['test_report_directory'], 'stock-product_stock_report.'+format), 'wb+').write(data)
56