[IMP]:point_of_sale:improt time
[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   In order to test the PDF reports defined on a Point of Sale, we will print a POS Receipt With Reimbursement Report
39 -
40   !python {model: pos.order}: |
41     import netsvc, tools, os
42     (data, format) = netsvc.LocalService('report.pos.receipt.with.remboursment').create(cr, uid, [ref('point_of_sale.order_pos1'), ref('point_of_sale.order_pos2')], {}, {})
43     if tools.config['test_report_directory']:
44         file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-receipt with reimbursement report'+format), 'wb+').write(data)
45
46 -
47   In order to test the PDF reports defined on a point of sale, we will print a POS Receipt Without Reimbursement Report
48 -
49   !python {model: pos.order}: |
50     import netsvc, tools, os
51     (data, format) = netsvc.LocalService('report.pos.receipt.without.remboursment').create(cr, uid, [ref('point_of_sale.order_pos1'), ref('point_of_sale.order_pos2')], {}, {})
52     if tools.config['test_report_directory']:
53         file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-receipt without reimbursement report'+format), 'wb+').write(data)
54
55 -
56  Print the POS Payment Report through the wizard
57 -
58   !python {model: ir.ui.menu}: |
59     import time
60     ctx={}
61     ctx.update({'model': 'ir.ui.menu','active_ids': []})
62     data_dict = {'date_start': time.strftime('%Y-%m-%d'), 'date_end': time.strftime('%Y-%m-%d'), 'user_id': [(6,0,[ref('base.user_root')])] }
63     from tools import test_reports
64     test_reports.try_report_action(cr, uid, 'action_report_pos_payment_repport_date',wiz_data=data_dict, context=ctx, our_module='point_of_sale')
65
66 -
67  Print the POS Details Report through the wizard
68 -
69   !python {model: ir.ui.menu}: |
70     import time
71     ctx={}
72     ctx.update({'model': 'ir.ui.menu','active_ids': []})
73     data_dict = {'date_start': time.strftime('%Y-%m-%d'), 'date_end': time.strftime('%Y-%m-%d')}
74     from tools import test_reports
75     test_reports.try_report_action(cr, uid, 'action_report_pos_details',wiz_data=data_dict, context=ctx, our_module='point_of_sale')
76
77 -
78   I create a cash journal.
79 -
80   !record {model: account.journal, id: account_journal_cash0}:
81     name: 'Cash Journal'
82     code: 'CSJ'
83     type: 'cash'
84     view_id: account.account_journal_bank_view
85     sequence_id: account.sequence_journal
86 -
87   I create a record for Bank Statement.
88 -
89   !record {model: account.bank.statement, id: account_bank_statement_st0}:
90     name: St.05/19
91     balance_end_real: 0.0
92     date: '2010-05-19'
93     journal_id: account_journal_cash0
94     line_ids:
95         - name: statement
96           date: "2010-10-13"
97           type: customer
98           account_id: account_pos_account_sales
99           amount: 100
100           partner_id: base.res_partner_agrolait
101     period_id: account.period_5
102     state: 'draft'
103 -
104   In order to test the PDF reports defined on a Point Of Sale, we will print a Account Statement Report
105 -
106   !python {model: account.bank.statement}: |
107     import netsvc, tools, os, time
108     (data, format) = netsvc.LocalService('report.account.statement').create(cr, uid, [ref('point_of_sale.account_bank_statement_st0')], {}, {})
109     if tools.config['test_report_directory']:
110         file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-account_statement_report'+format), 'wb+').write(data)
111 -
112   In order to test the PDF reports defined on a Point Of Sale, we will print a POS User Product Report
113 -
114   !python {model: account.bank.statement}: |
115     import netsvc, tools, os, time
116     (data, format) = netsvc.LocalService('report.pos.user.product').create(cr, uid, [ref('point_of_sale.account_bank_statement_st0')], {}, {})
117     if tools.config['test_report_directory']:
118         file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-user_product_report'+format), 'wb+').write(data)
119 -
120   In order to test the PDF reports defined on a Point Of Sale, we will print a POS All Close Cashbox Of the Day Report
121 -
122   !python {model: account.bank.statement}: |
123     import netsvc, tools, os, time
124     (data, format) = netsvc.LocalService('report.all.closed.cashbox.of.the.day').create(cr, uid, [ref('point_of_sale.account_bank_statement_st0')], {}, {})
125     if tools.config['test_report_directory']:
126         file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-all_closed_cash_box_of_the_day_report'+format), 'wb+').write(data)
127 -
128   In order to test the PDF reports defined on a Point of Sale, we will print a POS Sales User Report
129 -
130   !python {model: pos.order}: |
131     import netsvc, tools, os, time
132     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')] }}
133     (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, {})
134     if tools.config['test_report_directory']:
135         file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-sales_user_report'+format), 'wb+').write(data)
136 -
137   In order to test the PDF reports defined on a Point of Sale, we will print a POS Sales User Today Report
138 -
139   !python {model: pos.order}: |
140     import netsvc, tools, os, time
141     data_dict = {'model':'ir.ui.menu', 'form':{'user_id':[ref('base.user_root')] }}
142     (data, format) = netsvc.LocalService('report.pos.sales.user.today').create(cr, uid, [ref('point_of_sale.order_pos1'), ref('point_of_sale.order_pos2')], data_dict, {})
143     if tools.config['test_report_directory']:
144         file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-sales_user_today_report'+format), 'wb+').write(data)
145 -
146   In order to test the PDF reports defined on a Point of Sale, we will print a POS Payment Report
147 -
148   !python {model: pos.order}: |
149     import netsvc, tools, os, time
150     (data, format) = netsvc.LocalService('report.pos.payment.report').create(cr, uid, [ref('point_of_sale.pos_order_pos0')], {}, {})
151     if tools.config['test_report_directory']:
152         file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-payment_report'+format), 'wb+').write(data)
153 -
154   In order to test the PDF reports defined on a Point of Sale, we will print a POS Payment User Report
155 -
156   !python {model: pos.order}: |
157     import netsvc, tools, os, time
158     data_dict = {'model':'ir.ui.menu', 'form':{'user_id':[ref('base.user_root'),ref('base.user_demo')] }}
159     (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, {})
160     if tools.config['test_report_directory']:
161         file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-payment_user_report'+format), 'wb+').write(data)
162 -
163   In order to test the PDF reports defined on a Point of Sale, we will print a POS Today's Sales of Current User Report
164 -
165   !python {model: pos.order}: |
166     import netsvc, tools, os, time
167     (data, format) = netsvc.LocalService('report.pos.sales.user.today.current.user').create(cr, uid, [ref('point_of_sale.order_pos1'), ref('point_of_sale.order_pos2')], {}, {})
168     if tools.config['test_report_directory']:
169         file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-sales_today_current_user_report'+format), 'wb+').write(data)