Launchpad automatic translations update.
[odoo/odoo.git] / addons / point_of_sale / test / point_of_sale_report.yml
1 -
2   In order to test the PDF reports defined on a Point Of Sale,we will print a POS Detail Summary Report
3 -
4   !python {model: pos.order}: |
5     import netsvc, tools, os
6     (data, format) = netsvc.LocalService('report.pos.details_summary').create(cr, uid, [ref('point_of_sale.order_pos1'), ref('point_of_sale.order_pos2')], {}, {})
7     if tools.config['test_report_directory']:
8         file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-details_summary report'+format), 'wb+').write(data)
9
10 -
11   In order to test the PDF reports defined on a Point Of Sale, we will print a POS Invoice Report
12 -
13   !python {model: pos.order}: |
14     import netsvc, tools, os
15     (data, format) = netsvc.LocalService('report.pos.invoice').create(cr, uid, [ref('point_of_sale.pos_order_pos11')], {}, {})
16     if tools.config['test_report_directory']:
17         file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-invoice report'+format), 'wb+').write(data)
18
19 -
20   In order to test the PDF reports defined on a Point Of Sale, we will print a POS Lines Report
21 -
22   !python {model: pos.order}: |
23     import netsvc, tools, os
24     (data, format) = netsvc.LocalService('report.pos.lines').create(cr, uid, [ref('point_of_sale.order_pos1'), ref('point_of_sale.order_pos2')], {}, {})
25     if tools.config['test_report_directory']:
26         file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-lines report'+format), 'wb+').write(data)
27
28 -
29   In order to test the PDF reports defined on a Point of Sale, we will print a POS Receipt Report
30 -
31   !python {model: pos.order}: |
32     import netsvc, tools, os
33     (data, format) = netsvc.LocalService('report.pos.receipt').create(cr, uid, [ref('point_of_sale.order_pos1'), ref('point_of_sale.order_pos2')], {}, {})
34     if tools.config['test_report_directory']:
35         file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-receipt report'+format), 'wb+').write(data)
36
37 -
38  Create a record for the root user in pos.payment.report.user (used by the next python block).
39 -
40   !record {model: pos.payment.report.user, id: pos_payment_report_user_1}:
41     user_id: []
42 -
43  Print the POS Payment Report through the wizard
44 -
45   !python {model: ir.ui.menu}: |
46     import time
47     ctx={}
48     ctx.update({'model': 'ir.ui.menu','active_ids': []})
49     data_dict = {'date_start': time.strftime('%Y-%m-%d'), 'date_end': time.strftime('%Y-%m-%d'), 'user_id': [(6,0,[ref('base.user_root')])] }
50     from tools import test_reports
51     test_reports.try_report_action(cr, uid, 'action_report_pos_payment_repport_date',wiz_data=data_dict, context=ctx, our_module='point_of_sale')
52
53 -
54  Print the POS Details Report through the wizard
55 -
56   !python {model: ir.ui.menu}: |
57     import time
58     ctx={}
59     ctx.update({'model': 'ir.ui.menu','active_ids': []})
60     data_dict = {'date_start': time.strftime('%Y-%m-%d'), 'date_end': time.strftime('%Y-%m-%d')}
61     from tools import test_reports
62     test_reports.try_report_action(cr, uid, 'action_report_pos_details',wiz_data=data_dict, context=ctx, our_module='point_of_sale')
63
64 -
65   In order to test the PDF reports defined on a Point of Sale, we will print a POS Sales User Report
66 -
67   !python {model: pos.order}: |
68     import netsvc, tools, os, time
69     data_dict = {'model':'ir.ui.menu', 'form':{'date_start': time.strftime('%Y-%m-%d'), 'date_end': time.strftime('%Y-%m-%d'),'user_id':[ref('base.user_root')] }}
70     (data, format) = netsvc.LocalService('report.pos.sales.user').create(cr, uid, [ref('point_of_sale.order_pos1'), ref('point_of_sale.order_pos2')], data_dict, {})
71     if tools.config['test_report_directory']:
72         file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-sales_user_report'+format), 'wb+').write(data)
73 -
74   In order to test the PDF reports defined on a Point of Sale, we will print a POS Payment Report
75 -
76   !python {model: pos.order}: |
77     import netsvc, tools, os, time
78     (data, format) = netsvc.LocalService('report.pos.payment.report').create(cr, uid, [ref('point_of_sale.pos_order_pos0')], {}, {})
79     if tools.config['test_report_directory']:
80         file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-payment_report'+format), 'wb+').write(data)
81 -
82   In order to test the PDF reports defined on a Point of Sale, we will print a POS Payment User Report
83 -
84   !python {model: pos.order}: |
85     import netsvc, tools, os, time
86     data_dict = {'model':'ir.ui.menu', 'form':{'user_id':[ref('base.user_root'),ref('base.user_demo')] }}
87     (data, format) = netsvc.LocalService('report.pos.payment.report.user').create(cr, uid, [ref('point_of_sale.order_pos1'), ref('point_of_sale.order_pos2')], data_dict, {})
88     if tools.config['test_report_directory']:
89         file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-payment_user_report'+format), 'wb+').write(data)