2 In order to test anglo_saxon Configure Different Accounts.
4 !record {model: account.account, id: account_anglo_stock_valuation}:
6 name: Stock Valuation Account- (test)
9 user_type: account.data_account_type_asset
11 Configure Stock Interim account (Received).
13 !record {model: account.account, id: account_anglo_stock_input}:
15 name: Stock Interim account (Received)
16 parent_id: account.cos
18 user_type: account.data_account_type_expense
20 Configure Stock Interim account (Delivered).
22 !record {model: account.account, id: account_anglo_stock_output}:
24 name: Stock Interim account (Delivered)
25 parent_id: account.rev
27 user_type: account.data_account_type_income
29 Configure Price difference creditor Account.
31 !record {model: account.account, id: account_anglo_price_difference}:
33 name: Price difference creditor Account
34 parent_id: account.cos
36 user_type: account.data_account_type_expense
38 Configure Cash Bank Account.
40 !record {model: account.account, id: account_anglo_cash}:
42 name: Cash/Bank Account
43 parent_id: account.cash
45 user_type: account.data_account_type_asset
47 Configure Creditor Account Payable.
49 !record {model: account.account, id: account_anglo_payable}:
51 name: Creditor Account Payable
52 parent_id: account.a_pay
54 user_type: account.data_account_type_payable
56 Configure Debtor Account Receivable.
58 !record {model: account.account, id: account_anglo_receivable}:
60 name: Debtor Account Receivable
61 parent_id: account.a_recv
63 user_type: account.data_account_type_receivable
65 Configure Cost of Good sale Account.
67 !record {model: account.account, id: account_anglo_cogs}:
69 name: Cost of goods sale account
70 parent_id: account.o_expense
72 user_type: account.data_account_type_expense
74 Configure Income Account.
76 !record {model: account.account, id: account_anglo_income}:
79 parent_id: account.o_income
81 user_type: account.data_account_type_income
83 I configure the account receivable of supplier
85 !record {model: res.partner, id: base.res_partner_3}:
86 property_account_payable: account_anglo_payable
87 property_account_receivable: account_anglo_receivable
89 I configure the account receivable of Customer.
91 !record {model: res.partner, id: base.res_partner_13}:
92 property_account_payable: account_anglo_payable
93 property_account_receivable: account_anglo_receivable
95 I configure the product category with stock valuation account.
97 !record {model: product.category, id: product.product_category_4}:
98 property_stock_valuation_account_id: account_anglo_stock_valuation
100 I configure the product with required accounts, and cost method = standard
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'})
108 I create a draft Purchase Order.
110 !record {model: purchase.order, id: purchase_order_001}:
111 partner_id: base.res_partner_3
112 location_id: stock.stock_location_stock
115 - product_id: product.product_product_3
118 date_planned: '2013-08-31'
120 I confirm the purchase order.
122 !workflow {model: purchase.order, ref: purchase_order_001, action: purchase_confirm}
124 Reception is ready for process so now done the reception.
126 !python {model: stock.picking}: |
127 picking_id = self.pool.get('purchase.order').browse(cr, uid, ref("purchase_order_001")).picking_ids[0]
128 picking_id.do_transfer(context=context)
130 I check the Stock Interim account (Received) is credited successfully.
132 !assert {model: account.account, id : account_anglo_stock_input, string : Stock Interim account (Received) is not credited successfully.}:
135 I check the Stock valuation account is debited sucessfully.
137 !assert {model: account.account, id : account_anglo_stock_valuation, string : Stock valuation account is not debited successfully.}:
140 I Validate Invoice of Purchase Order.
142 !python {model: purchase.order}: |
143 invoice_ids = [x.id for x in self.browse(cr, uid, ref("purchase_order_001")).invoice_ids]
144 self.pool.get('account.invoice').signal_invoice_open(cr, uid, invoice_ids)
146 I check the Stock Interim account (Received) is debited sucessfully when Invoice validated.
148 !assert {model: account.account, id : account_anglo_stock_input, string : Stock Interim account (Received) is not debited successfully.}:
151 I check the Price difference creditor Account is debited sucessfully when Invoice validated.
153 !assert {model: account.account, id : account_anglo_price_difference, string : Price difference creditor Account is not debited successfully.}:
156 I check Payable(creditor) Account is Credited sucessfully when Invoice validated.
158 !assert {model: account.account, id : account_anglo_payable, string : Payable(creditor) Account is not Credited successfully.}:
163 !python {model: purchase.order}: |
164 po = self.browse(cr, uid, ref("purchase_order_001"))
165 for invoice in po.invoice_ids:
166 self.pool.get('account.invoice').signal_invoice_open(cr, uid, [invoice.id])
170 !python {model: purchase.order}: |
171 invoice_ids = self.browse(cr, uid, ref("purchase_order_001")).invoice_ids
172 order = self.browse(cr, uid, ref("purchase_order_001"))
173 journal_ids = self.pool.get('account.journal').search(cr, uid, [('type', '=', 'cash'), ('company_id', '=', order.company_id.id)], limit=1)
174 for invoice in invoice_ids:
175 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 I check Payable(Creditors) Account is Debited sucessfully after invoice paid.
179 !assert {model: account.account, id : account_anglo_payable, string : Payable(Creditors) Account is not Debited successfully.}:
182 I check Bank/Cash account is credited sucessfully after invoice paid.
184 !assert {model: account.account, id : account_anglo_cash, string: Bank/Cash account is not credited successfully.}:
187 I create an Outgoing Picking order
189 !record {model: stock.picking, id: stock_picking_out001}:
190 partner_id: base.res_partner_13
192 - company_id: base.main_company
193 location_id: stock.stock_location_stock
194 product_id: product.product_product_3
196 product_uom: product.product_uom_unit
197 location_dest_id: stock.stock_location_customers
198 invoice_state: 2binvoiced
200 picking_type_id: stock.picking_type_out
202 I need to check the availability of the product, So I make my picking order for processing later.
204 !python {model: stock.picking}: |
205 self.action_confirm(cr, uid, [ref('stock_picking_out001')], context=context)
208 I check the product availability, Product is available in the stock and ready to be sent.
210 !python {model: stock.picking}: |
211 picking = self.browse(cr, uid, ref("stock_picking_out001"))
212 assert picking.state == "confirmed", "Picking should be confirmed."
213 for move_line in picking.move_lines:
214 assert move_line.state == "confirmed", "Move should be confirmed."
217 I process the delivery.
219 !python {model: stock.picking}: |
220 picking = self.pool.get('stock.picking').browse(cr, uid, ref("stock_picking_out001"))
221 picking.do_transfer(context=context)
223 I check Stock Interim account (Delivery) is debited successfully.
225 !assert {model: account.account, id : account_anglo_stock_output, string : Stock Interim account (Delivery) is not debited successfully.}:
228 I check the Stock valuation account is credited sucessfully.
230 !assert {model: account.account, id : account_anglo_stock_valuation, string : Stock valuation account is not credited successfully.}:
233 As the Invoice state of the picking order is To be invoiced. I create invoice for my outgoing picking order.
235 !python {model: stock.invoice.onshipping}: |
237 wiz_id = self.create(cr, uid, {'invoice_date': time.strftime('%Y-03-04'), 'journal_id': ref('account.sales_journal')},
238 {'active_ids': [ref("stock_picking_out001")], "active_model": "stock.picking"})
239 self.create_invoice(cr, uid, [wiz_id], {"active_ids": [ref("stock_picking_out001")], "active_id": ref("stock_picking_out001")})
241 I check that the customer invoice is created successfully.
243 !python {model: account.invoice}: |
244 partner_id = self.pool.get('stock.picking').browse(cr, uid, ref('stock_picking_out001')).partner_id.id
245 inv_ids = self.search(cr, uid, [('type','=','out_invoice'),('partner_id','=',partner_id)])
246 assert inv_ids, 'No Invoice is generated!'
250 !python {model: stock.picking}: |
251 move_name = self.pool.get('stock.picking').browse(cr, uid, ref('stock_picking_out001')).name
252 account_invoice = self.pool.get('account.invoice').search(cr, uid, [('origin', '=', move_name)])
253 self.pool.get('account.invoice').signal_invoice_open(cr, uid, account_invoice)
255 I check Income Account is Credited sucessfully when Invoice validated.
257 !assert {model: account.account, id : account_anglo_income, string : Income Account is not Credited successfully.}:
260 I check Cost of goods sold account for debit.
262 !assert {model: account.account, id : account_anglo_cogs, string : Cost of goods sale is not Debited successfully.}:
265 I check Stock Interim account (Delivery)
267 !assert {model: account.account, id : account_anglo_stock_output, string : Stock Interim account (Delivery) is not credited successfully.}:
270 I check Receivable(Debtor) Account for debit.
272 !assert {model: account.account, id : account_anglo_receivable, string : Receivable(Debtors) Account is not Debited successfully.}:
277 !python {model: account.invoice}: |
278 move_name = self.pool.get('stock.picking').browse(cr, uid, ref('stock_picking_out001')).name
279 account_invoice= self.pool.get('account.invoice').search(cr, uid, [('origin', '=', move_name)])
280 journal_ids = self.pool.get('account.journal').search(cr, uid, [('type', '=', 'cash')], limit=1)
281 pay = self.pay_and_reconcile(cr, uid, account_invoice,
282 20.0, ref('account_anglo_cash'), ref('account.period_8'),
283 journal_ids[0], ref('account_anglo_cash'),
284 ref('account.period_8'), journal_ids[0],
285 name='Payment for test customer invoice')
286 assert (pay == True), "Incorrect Payment."
288 I check Receivable(Debtor) Account for credit.
290 !assert {model: account.account, id : account_anglo_receivable, string : Receivable(Debtors) Account is not Credited successfully.}:
293 I check Bank/Cash account is debited sucessfully after invoice paid.
295 !assert {model: account.account, id : account_anglo_cash, string: Bank/Cash account is not successfully credited.}: