2 In order to test the PDF reports defined on a Point Of Sale,we will print a POS Detail Summary Report
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)
11 In order to test the PDF reports defined on a Point Of Sale, we will print a POS Invoice Report
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)
20 In order to test the PDF reports defined on a Point Of Sale, we will print a POS Lines Report
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)
29 In order to test the PDF reports defined on a Point of Sale, we will print a POS Receipt Report
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)
38 Create a record for the root user in pos.payment.report.user (used by the next python block).
40 !record {model: pos.payment.report.user, id: pos_payment_report_user_1}:
43 Print the POS Payment Report through the wizard
45 !python {model: ir.ui.menu}: |
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')
54 Print the POS Details Report through the wizard
56 !python {model: ir.ui.menu}: |
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')
65 In order to test the PDF reports defined on a Point of Sale, we will print a POS Sales User Report
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)
74 In order to test the PDF reports defined on a Point of Sale, we will print a POS Payment Report
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)
82 In order to test the PDF reports defined on a Point of Sale, we will print a POS Payment User Report
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)