[IMP] URL of blogs
[odoo/odoo.git] / addons / account_anglo_saxon / test / anglo_saxon.yml
1 -
2   In order to test anglo_saxon Configure Different Accounts.
3 -
4   !record {model: account.account, id: account_anglo_stock_valuation}:
5     code: X3000
6     name: Stock Valuation Account- (test)
7     parent_id: account.cas
8     type: other
9     user_type: account.data_account_type_asset
10 -
11   Configure Stock Interim account (Received).
12 -
13   !record {model: account.account, id: account_anglo_stock_input}:
14     code: X2800
15     name: Stock Interim account (Received)
16     parent_id: account.cos
17     type: other
18     user_type: account.data_account_type_expense
19 -
20   Configure Stock Interim account (Delivered).
21 -
22   !record {model: account.account, id: account_anglo_stock_output}:
23     code: X2801
24     name: Stock Interim account (Delivered)
25     parent_id: account.rev
26     type: other
27     user_type: account.data_account_type_income
28 -
29   Configure Price difference creditor Account.
30 -
31   !record {model: account.account, id: account_anglo_price_difference}:
32     code: X7095
33     name: Price difference creditor Account
34     parent_id: account.cos
35     type: other
36     user_type: account.data_account_type_expense
37 -
38   Configure Cash Bank Account.
39 -
40   !record {model: account.account, id: account_anglo_cash}:
41     code: X5000
42     name: Cash/Bank Account 
43     parent_id: account.cash  
44     type: other
45     user_type: account.data_account_type_asset
46 -
47   Configure Creditor Account Payable. 
48 -
49   !record {model: account.account, id: account_anglo_payable}:
50     code: X440001
51     name: Creditor Account Payable 
52     parent_id: account.a_pay  
53     type: other
54     user_type: account.data_account_type_payable
55 -
56   Configure Debtor Account Receivable. 
57 -
58   !record {model: account.account, id: account_anglo_receivable}:
59     code: X400001
60     name: Debtor Account Receivable 
61     parent_id: account.a_recv  
62     type: other
63     user_type: account.data_account_type_receivable
64 -
65   Configure Cost of Good sale Account.
66 -
67   !record {model: account.account, id: account_anglo_cogs}:
68     code: X7000
69     name: Cost of goods sale account
70     parent_id: account.o_expense
71     type: other
72     user_type: account.data_account_type_expense
73 -
74   Configure Income Account.
75 -
76   !record {model: account.account, id: account_anglo_income}:
77     code: X8000
78     name: Income Account
79     parent_id: account.o_income
80     type: other
81     user_type: account.data_account_type_income
82 -
83   I configure the account receivable of supplier
84 -
85   !record {model: res.partner, id: base.res_partner_3}:
86     property_account_payable: account_anglo_payable
87     property_account_receivable: account_anglo_receivable
88 -
89   I configure the account receivable of Customer.
90 -
91   !record {model: res.partner, id: base.res_partner_13}:
92     property_account_payable: account_anglo_payable
93     property_account_receivable: account_anglo_receivable
94 -
95   I configure the product category with stock valuation account.
96 -
97   !record {model: product.category, id: product.product_category_4}:
98     property_stock_valuation_account_id: account_anglo_stock_valuation
99 -
100   I configure the product with required accounts, and cost method = standard
101 -
102   !python {model: product.product}: |
103      self.write(cr, uid, [ref('product.product_product_3')], {'list_price': 20.00,'standard_price': 9,'categ_id': ref('product.product_category_4'),'valuation': 'real_time',
104       'property_account_income': ref('account_anglo_income'),'property_account_expense': ref('account_anglo_cogs'),
105       'property_account_creditor_price_difference': ref('account_anglo_price_difference'),'property_stock_account_input': ref('account_anglo_stock_input'),
106       'property_stock_account_output': ref('account_anglo_stock_output'), 'cost_method': 'standard'})
107 -
108   I create a draft Purchase Order.
109 -
110   !record {model: purchase.order, id: purchase_order_001}:
111     partner_id: base.res_partner_3
112     location_id: stock.stock_location_stock
113     pricelist_id: 1
114     order_line:
115       - product_id: product.product_product_3
116         product_qty: 1
117         price_unit: 10
118         date_planned: '2013-08-31'
119 -
120   I confirm the purchase order.
121 -
122   !workflow {model: purchase.order, ref: purchase_order_001, action: purchase_confirm}
123 -
124   Reception is ready for process so now done the reception.
125 -
126   !python {model: stock.partial.picking}: |
127     pick_ids = self.pool.get('purchase.order').browse(cr, uid, ref("purchase_order_001")).picking_ids
128     partial_id = self.create(cr, uid, {},context={'active_model': 'stock.picking','active_ids': [pick_ids[0].id]})
129     self.do_partial(cr, uid, [partial_id])
130 -
131   I check the Stock Interim account (Received) is credited successfully.
132 -
133   !assert {model: account.account, id : account_anglo_stock_input, string : Stock Interim account (Received) is not credited successfully.}:
134     - credit == 9
135 -
136   I check the Stock valuation account is debited sucessfully.
137 -
138   !assert {model: account.account, id : account_anglo_stock_valuation, string : Stock valuation account is not debited successfully.}:
139     - debit == 9
140 -
141   I Validate Invoice of Purchase Order.
142 -
143   !python {model: purchase.order}: |
144     invoice_ids = [x.id for x in self.browse(cr, uid, ref("purchase_order_001")).invoice_ids]
145     self.pool.get('account.invoice').signal_invoice_open(cr, uid, invoice_ids)
146 -
147   I check the Stock Interim account (Received) is debited sucessfully when Invoice validated.
148 -
149   !assert {model: account.account, id : account_anglo_stock_input, string : Stock Interim account (Received) is not debited successfully.}:
150     - debit == 9
151 -
152   I check the Price difference creditor Account is debited sucessfully when Invoice validated.
153 -
154   !assert {model: account.account, id : account_anglo_price_difference, string : Price difference creditor Account is not debited successfully.}:
155     - debit == 1
156 -
157   I check Payable(creditor) Account is Credited sucessfully when Invoice validated.
158 -
159   !assert {model: account.account, id : account_anglo_payable, string : Payable(creditor) Account is not Credited successfully.}:
160     - credit == 10
161 -
162   I open the Invoice.
163 -
164   !python {model: purchase.order}: |
165     po = self.browse(cr, uid, ref("purchase_order_001"))
166     for invoice in po.invoice_ids:
167       self.pool.get('account.invoice').signal_invoice_open(cr, uid, [invoice.id])
168 -
169   I pay the invoice.
170 -
171   !python {model: purchase.order}: |
172     invoice_ids = self.browse(cr, uid, ref("purchase_order_001")).invoice_ids
173     order = self.browse(cr, uid, ref("purchase_order_001"))
174     journal_ids = self.pool.get('account.journal').search(cr, uid, [('type', '=', 'cash'), ('company_id', '=', order.company_id.id)], limit=1)
175     for invoice in invoice_ids:
176         invoice.pay_and_reconcile(invoice.amount_total, ref('account_anglo_cash'), ref('account.period_8'), journal_ids[0], ref('account_anglo_cash'), ref('account.period_8'), journal_ids[0], name='test')
177 -
178   I check Payable(Creditors) Account is Debited sucessfully after invoice paid.
179 -
180   !assert {model: account.account, id : account_anglo_payable, string : Payable(Creditors) Account is not Debited successfully.}:
181     - debit == 10
182 -
183   I check Bank/Cash account is credited sucessfully after invoice paid.
184 -
185   !assert {model: account.account, id : account_anglo_cash, string: Bank/Cash account is not credited successfully.}:
186     - credit == 10
187 -
188   I create an Outgoing Picking order
189 -
190   !record {model: stock.picking, id: stock_picking_out001}:
191     partner_id: base.res_partner_13
192     invoice_state: 2binvoiced
193     move_lines:
194       - company_id: base.main_company
195         location_id: stock.stock_location_stock
196         product_id: product.product_product_3
197         product_qty: 1.0
198         product_uom: product.product_uom_unit
199         location_dest_id: stock.stock_location_customers
200     move_type: direct
201     type: out
202 -
203   I need to check the availability of the product, So I make my picking order for processing later.
204 -
205   !python {model: stock.picking}: |
206     self.draft_force_assign(cr, uid, [ref("stock_picking_out001")], {"lang": "en_US", "search_default_available":
207       1, "tz": False, "active_model": "ir.ui.menu", "contact_display": "partner",
208       "active_ids": [ref("stock.menu_action_picking_tree")], "active_id": ref("stock.menu_action_picking_tree"),
209       })
210 -
211   I check the product availability, Product is available in the stock and ready to be sent.
212 -
213   !python {model: stock.picking}: |
214     self.action_assign(cr, uid, [ref("stock_picking_out001")], {"lang": "en_US", "search_default_available":
215       1, "tz": False, "active_model": "ir.ui.menu", "contact_display": "partner",
216       "active_ids": [ref("stock.menu_action_picking_tree")], "active_id": ref("stock.menu_action_picking_tree"),
217       })
218 -
219   I process the delivery.
220 -
221   !python {model: stock.partial.picking}: |
222     partial_id = self.create(cr, uid, {}, context={'active_model':'stock.picking','active_ids':[ref('stock_picking_out001')]})
223     self.do_partial(cr, uid, [partial_id])
224
225   I check Stock Interim account (Delivery) is debited successfully.
226 -
227   !assert {model: account.account, id : account_anglo_stock_output, string : Stock Interim account (Delivery) is not debited successfully.}:
228     - debit == 9
229 -
230   I check the Stock valuation account is credited sucessfully.
231 -
232   !assert {model: account.account, id : account_anglo_stock_valuation, string : Stock valuation account is not credited successfully.}: 
233     - credit == 9
234 -
235   As the Invoice state of the picking order is To be invoiced. I create invoice for my outgoing picking order.
236 -
237   !python {model: stock.invoice.onshipping}: |
238     wiz_id = self.create(cr, uid, {'invoice_date': '2013-03-04', 'journal_id': ref('account.sales_journal')},
239       {'active_ids': [ref("stock_picking_out001")], "active_model": "stock.picking"})
240     self.create_invoice(cr, uid, [wiz_id], {"lang": "en_US",
241       "search_default_available": 1, "tz": False, "active_model": "stock.picking",
242       "contact_display": "partner", "active_ids": [ref("stock_picking_out001")], "active_id": ref("stock_picking_out001")})
243 -
244   I check that the customer invoice is created successfully.
245 -
246   !python {model: account.invoice}: |
247     partner_id = self.pool.get('stock.picking').browse(cr, uid, ref('stock_picking_out001')).partner_id.id
248     inv_ids = self.search(cr, uid, [('type','=','out_invoice'),('partner_id','=',partner_id)])
249     assert inv_ids, 'No Invoice is generated!'
250 -
251   I open the Invoice.
252 -
253   !python {model: stock.picking}: |
254     move_name = self.pool.get('stock.picking').browse(cr, uid, ref('stock_picking_out001')).name
255     account_invoice = self.pool.get('account.invoice').search(cr, uid, [('origin', '=', move_name)])
256     self.pool.get('account.invoice').signal_invoice_open(cr, uid, account_invoice)
257 -
258   I check Income Account is Credited sucessfully when Invoice validated.
259 -
260   !assert {model: account.account, id : account_anglo_income, string : Income Account is not Credited successfully.}:
261     - credit == 20
262 -
263   I check Cost of goods sold account for debit.
264 -
265   !assert {model: account.account, id : account_anglo_cogs, string : Cost of goods sale is not Debited successfully.}:
266     - debit == 9
267 -
268   I check Stock Interim account (Delivery)
269 -
270   !assert {model: account.account, id : account_anglo_stock_output, string : Stock Interim account (Delivery) is not credited successfully.}:
271     - credit == 9
272 -
273   I check Receivable(Debtor) Account for debit.
274 -
275   !assert {model: account.account, id : account_anglo_receivable, string : Receivable(Debtors) Account is not Debited successfully.}: 
276     - debit == 20
277 -
278   I pay the invoice.
279 -
280   !python {model: account.invoice}: |
281     move_name = self.pool.get('stock.picking').browse(cr, uid, ref('stock_picking_out001')).name
282     account_invoice= self.pool.get('account.invoice').search(cr, uid, [('origin', '=', move_name)])
283     journal_ids = self.pool.get('account.journal').search(cr, uid, [('type', '=', 'cash')], limit=1)
284     pay = self.pay_and_reconcile(cr, uid, account_invoice,
285                         20.0, ref('account_anglo_cash'), ref('account.period_8'),
286                         journal_ids[0], ref('account_anglo_cash'),
287                         ref('account.period_8'), journal_ids[0],
288                         name='Payment for test customer invoice')
289     assert (pay == True), "Incorrect Payment."
290 -
291   I check Receivable(Debtor) Account for credit.
292 -
293   !assert {model: account.account, id : account_anglo_receivable, string : Receivable(Debtors) Account is not Credited successfully.}: 
294     - credit == 20
295 -
296   I check Bank/Cash account is debited sucessfully after invoice paid.
297 -
298   !assert {model: account.account, id : account_anglo_cash, string: Bank/Cash account is not successfully credited.}:
299     - debit == 20