[FIX] sale_journal
bzr revid: mra@mra-laptop-20100622091819-rjus247cnseppssd
This commit is contained in:
@@ -2,41 +2,41 @@
|
||||
In order to test the sale module in the Open-ERP, I need to configure details regarding product & customer.
|
||||
-
|
||||
I am going to sell my Mobile products to the customer with name Cleartrail
|
||||
-
|
||||
-
|
||||
I create View Account Type.
|
||||
-
|
||||
-
|
||||
!record {model: account.account.type, id: account_account_type_view0}:
|
||||
close_method: none
|
||||
code: View
|
||||
name: View
|
||||
sign: 1
|
||||
-
|
||||
-
|
||||
I create Income Account Type.
|
||||
-
|
||||
-
|
||||
!record {model: account.account.type, id: account_account_type_income0}:
|
||||
close_method: unreconciled
|
||||
code: Income
|
||||
name: Income
|
||||
sign: 1
|
||||
-
|
||||
-
|
||||
I create Expense Account Type.
|
||||
-
|
||||
-
|
||||
!record {model: account.account.type, id: account_account_type_expense0}:
|
||||
close_method: unreconciled
|
||||
code: Expense
|
||||
name: Expense
|
||||
sign: 1
|
||||
-
|
||||
-
|
||||
I create Cash Account Type.
|
||||
-
|
||||
-
|
||||
!record {model: account.account.type, id: account_account_type_cash0}:
|
||||
close_method: balance
|
||||
code: Cash
|
||||
name: Cash
|
||||
sign: 1
|
||||
-
|
||||
-
|
||||
I create Minimal Chart Account.
|
||||
-
|
||||
-
|
||||
!record {model: account.account, id: account_account_minimalchart0}:
|
||||
code: '0'
|
||||
company_id: base.main_company
|
||||
@@ -46,9 +46,9 @@
|
||||
parent_right: 12
|
||||
type: view
|
||||
user_type: account_account_type_view0
|
||||
-
|
||||
-
|
||||
I create Payable Account.
|
||||
-
|
||||
-
|
||||
!record {model: account.account, id: account_account_payable1}:
|
||||
code: AP
|
||||
company_id: base.main_company
|
||||
@@ -60,12 +60,11 @@
|
||||
reconcile: true
|
||||
type: payable
|
||||
user_type: account_account_type_expense0
|
||||
-
|
||||
-
|
||||
I create Receivable Account.
|
||||
-
|
||||
-
|
||||
!record {model: account.account, id: account_account_receivable0}:
|
||||
code: AR
|
||||
company_id: base.main_company
|
||||
currency_mode: current
|
||||
name: Receivable
|
||||
parent_id: account_account_minimalchart0
|
||||
@@ -74,9 +73,9 @@
|
||||
reconcile: true
|
||||
type: receivable
|
||||
user_type: account_account_type_income0
|
||||
-
|
||||
-
|
||||
I create Cash Account.
|
||||
-
|
||||
-
|
||||
!record {model: account.account, id: account_account_cash0}:
|
||||
code: C
|
||||
company_id: base.main_company
|
||||
@@ -87,9 +86,9 @@
|
||||
parent_right: 7
|
||||
type: other
|
||||
user_type: account_account_type_cash0
|
||||
-
|
||||
-
|
||||
I create Purchases Account.
|
||||
-
|
||||
-
|
||||
!record {model: account.account, id: account_account_purchases0}:
|
||||
code: P
|
||||
company_id: base.main_company
|
||||
@@ -100,9 +99,9 @@
|
||||
parent_right: 9
|
||||
type: other
|
||||
user_type: account_account_type_expense0
|
||||
-
|
||||
-
|
||||
I create Sales Account.
|
||||
-
|
||||
-
|
||||
!record {model: account.account, id: account_account_sales0}:
|
||||
code: S
|
||||
company_id: base.main_company
|
||||
@@ -113,9 +112,9 @@
|
||||
parent_right: 11
|
||||
type: other
|
||||
user_type: account_account_type_income0
|
||||
-
|
||||
-
|
||||
I create Purchase Journal.
|
||||
-
|
||||
-
|
||||
!record {model: account.journal, id: account_journal_purchasejournal0}:
|
||||
code: PUJ
|
||||
company_id: base.main_company
|
||||
@@ -125,9 +124,9 @@
|
||||
sequence_id: account.sequence_purchase_journal
|
||||
type: purchase
|
||||
view_id: account.account_journal_view
|
||||
-
|
||||
-
|
||||
I create Sale Journal.
|
||||
-
|
||||
-
|
||||
!record {model: account.journal, id: account_journal_salejournal0}:
|
||||
code: SAJ
|
||||
company_id: base.main_company
|
||||
@@ -137,84 +136,83 @@
|
||||
sequence_id: account.sequence_sale_journal
|
||||
type: sale
|
||||
view_id: account.account_journal_view
|
||||
-
|
||||
-
|
||||
I create Bank Journal.
|
||||
-
|
||||
-
|
||||
!record {model: account.journal, id: account_journal_bankjournal0}:
|
||||
code: BNK
|
||||
company_id: base.main_company
|
||||
default_credit_account_id: account_account_cash0
|
||||
default_debit_account_id: account_account_cash0
|
||||
name: Bank Journal
|
||||
sequence_id: account.sequence_journal
|
||||
type: cash
|
||||
view_id: account.account_journal_bank_view
|
||||
-
|
||||
-
|
||||
I create ir.property for account payable.
|
||||
-
|
||||
-
|
||||
!record {model: ir.property, id: ir_property_propertyaccountexpensecateg0}:
|
||||
company_id: base.main_company
|
||||
fields_id: account.field_res_partner_property_account_payable
|
||||
name: property_account_expense_categ
|
||||
value_reference: account.account,5
|
||||
-
|
||||
-
|
||||
I create ir.property for account receivable.
|
||||
-
|
||||
-
|
||||
!record {model: ir.property, id: ir_property_propertyaccountincomecateg0}:
|
||||
company_id: base.main_company
|
||||
fields_id: account.field_res_partner_property_account_receivable
|
||||
name: property_account_income_categ
|
||||
value_reference: account.account,6
|
||||
-
|
||||
-
|
||||
I create Partner category Customers.
|
||||
-
|
||||
-
|
||||
!record {model: res.partner.category, id: res_partner_category_customers0}:
|
||||
name: Customers
|
||||
-
|
||||
I create Cleartrail Customer.
|
||||
-
|
||||
-
|
||||
!record {model: res.partner, id: res_partner_cleartrail0}:
|
||||
category_id:
|
||||
- res_partner_category_customers0
|
||||
name: Cleartrail
|
||||
-
|
||||
-
|
||||
I create contact address for Cleartrail.
|
||||
-
|
||||
-
|
||||
!record {model: res.partner.address, id: res_partner_address_1}:
|
||||
partner_id: res_partner_cleartrail0
|
||||
street: onam plaza, 14 B palasia A B Road
|
||||
type: contact
|
||||
-
|
||||
-
|
||||
I create invoice address for Cleartrail.
|
||||
-
|
||||
-
|
||||
!record {model: res.partner.address, id: res_partner_address_2}:
|
||||
partner_id: res_partner_cleartrail0
|
||||
street: sarda house 24 B palasia, A B Road
|
||||
type: invoice
|
||||
-
|
||||
-
|
||||
I create delivery address for Cleartrail.
|
||||
-
|
||||
-
|
||||
!record {model: res.partner.address, id: res_partner_address_3}:
|
||||
partner_id: res_partner_cleartrail0
|
||||
street: sangam house 15 B palasia, A B Road
|
||||
type: delivery
|
||||
-
|
||||
Customer Cleartrail has specific instrument requirement regarding the stockable products.
|
||||
-
|
||||
-
|
||||
I define product category Mobile Products Sellable.
|
||||
-
|
||||
-
|
||||
!record {model: product.category, id: product_category_allproductssellable0}:
|
||||
name: Mobile Products Sellable
|
||||
|
||||
|
||||
-
|
||||
I define product category Mobile Services.
|
||||
-
|
||||
|
||||
|
||||
-
|
||||
I define product category Mobile Services.
|
||||
-
|
||||
!record {model: product.category, id: product_category_services0}:
|
||||
name: Mobile Services
|
||||
-
|
||||
-
|
||||
I define LG Viewty Smart product template.
|
||||
-
|
||||
-
|
||||
!record {model: product.template, id: product_template_lgviewtysmart0}:
|
||||
categ_id: product_category_allproductssellable0
|
||||
cost_method: standard
|
||||
@@ -227,9 +225,9 @@
|
||||
type: product
|
||||
uom_id: product.product_uom_unit
|
||||
uom_po_id: product.product_uom_unit
|
||||
-
|
||||
-
|
||||
I define LG Viewty Smart product.
|
||||
-
|
||||
-
|
||||
!record {model: product.product, id: product_product_lgviewtysmart0}:
|
||||
categ_id: product_category_allproductssellable0
|
||||
cost_method: standard
|
||||
@@ -249,7 +247,7 @@
|
||||
uom_po_id: product.product_uom_unit
|
||||
-
|
||||
I create a Sale Order for LG Viewty Smart for qty 500 having order_policy prepaid.
|
||||
-
|
||||
-
|
||||
!record {model: sale.order, id: sale_order_so1}:
|
||||
date_order: '2010-05-03'
|
||||
invoice_quantity: order
|
||||
@@ -273,11 +271,11 @@
|
||||
picking_policy: direct
|
||||
pricelist_id: product.list0
|
||||
shop_id: sale.shop
|
||||
|
||||
|
||||
-
|
||||
|
||||
|
||||
-
|
||||
I confirm the sale order.
|
||||
-
|
||||
-
|
||||
!workflow {model: sale.order, action: order_confirm, ref: sale_order_so1}
|
||||
-
|
||||
I will verify whether the invoice has been generated for SO since Shipping policy is 'Payment Before Delivery'
|
||||
@@ -285,67 +283,67 @@
|
||||
!python {model: sale.order}: |
|
||||
so = self.browse(cr, uid, ref("sale_order_so1"))
|
||||
assert so.invoice_ids, "Invoices has not been generated for sale_order_so1"
|
||||
-
|
||||
-
|
||||
I open the Invoice for the SO.
|
||||
-
|
||||
-
|
||||
!python {model: account.invoice}: |
|
||||
sale_order_obj = self.pool.get('sale.order')
|
||||
so = sale_order_obj.browse(cr, uid, ref("sale_order_so1"))
|
||||
import netsvc
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
invoice_ids = so.invoice_ids
|
||||
for invoice in invoice_ids:
|
||||
wf_service.trg_validate(uid, 'account.invoice',invoice.id,'invoice_open', cr)
|
||||
wf_service.trg_validate(uid, 'account.invoice',invoice.id,'invoice_open', cr)
|
||||
-
|
||||
Creating a account invoice pay entry.
|
||||
-
|
||||
-
|
||||
!record {model: account.invoice.pay, id: account_invoice_pay_tst1}:
|
||||
amount: 85000.0
|
||||
date: '2010-05-10'
|
||||
journal_id: sale.account_journal_bankjournal0
|
||||
name: tst
|
||||
period_id: account.period_5
|
||||
-
|
||||
-
|
||||
I pay the invoice.
|
||||
-
|
||||
-
|
||||
!python {model: account.invoice.pay}: |
|
||||
sale_order_obj = self.pool.get('sale.order')
|
||||
so = sale_order_obj.browse(cr, uid, ref("sale_order_so1"))
|
||||
so = sale_order_obj.browse(cr, uid, ref("sale_order_so1"))
|
||||
self.wo_check(cr, uid, [ref("account_invoice_pay_tst1")], {"lang": "en_US", "tz":
|
||||
False, "active_model": 'account.invoice', "active_ids": [so.invoice_ids[0].id], "type":
|
||||
"out_invoice", "active_id": so.invoice_ids[0].id, })
|
||||
|
||||
|
||||
-
|
||||
|
||||
|
||||
-
|
||||
Creating an account invoice pay writeoff entry.
|
||||
-
|
||||
-
|
||||
!record {model: account.invoice.pay.writeoff, id: account_invoice_pay_writeoff_0}:
|
||||
analytic_id: account.analytic_customers
|
||||
comment: Write-Off
|
||||
writeoff_acc_id: account.a_sale
|
||||
writeoff_journal_id: sale.account_journal_bankjournal0
|
||||
|
||||
|
||||
-
|
||||
|
||||
|
||||
-
|
||||
Pay and Reconcile the Invoice.
|
||||
-
|
||||
-
|
||||
!python {model: account.invoice.pay.writeoff}: |
|
||||
sale_order_obj = self.pool.get('sale.order')
|
||||
so = sale_order_obj.browse(cr, uid, ref("sale_order_so1"))
|
||||
so = sale_order_obj.browse(cr, uid, ref("sale_order_so1"))
|
||||
self.pay_and_reconcile_writeoff(cr, uid, [ref("account_invoice_pay_writeoff_0")],
|
||||
{"lang": 'en_US', "tz": False, "active_model": 'account.invoice', "active_ids":
|
||||
[so.invoice_ids[0].id], "type": "out_invoice", "active_id": so.invoice_ids[0].id })
|
||||
|
||||
|
||||
|
||||
|
||||
-
|
||||
I will verify the picking associated with the sale order sale_order_so1
|
||||
-
|
||||
-
|
||||
!python {model: sale.order}: |
|
||||
so = self.browse(cr, uid, ref("sale_order_so1"))
|
||||
assert so.picking_ids,"Picking has not been generated for sale_order_so1"
|
||||
-
|
||||
-
|
||||
Products are delivered to the Cleartrail Customer.
|
||||
-
|
||||
-
|
||||
!python {model: stock.picking }: |
|
||||
import time
|
||||
sale_order_obj = self.pool.get('sale.order')
|
||||
@@ -371,9 +369,9 @@
|
||||
-
|
||||
!python {model: stock.picking }: |
|
||||
sale_order_obj = self.pool.get('sale.order')
|
||||
so = sale_order_obj.browse(cr, uid, ref("sale_order_so1"))
|
||||
so = sale_order_obj.browse(cr, uid, ref("sale_order_so1"))
|
||||
picking_id = self.search(cr, uid, [('origin','=',so.name),('type','=','out')])
|
||||
|
||||
|
||||
if picking_id:
|
||||
pick = self.browse(cr,uid,picking_id[0])
|
||||
assert (pick.state) =='done', "Picking for SO is not in done state."
|
||||
|
||||
Reference in New Issue
Block a user