[ADD] sale: yml test for advance invoice has been added.
bzr revid: mso@mso-20100512091322-c22rzpbz1g7jxaa2
This commit is contained in:
@@ -0,0 +1,330 @@
|
||||
-
|
||||
In order to test the sale module in the Open-ERP, I need to configure details regarding product & customer.
|
||||
-
|
||||
I want to sell my mobile products to the customer with name Cleartrail
|
||||
-
|
||||
Creating an account.account.type record
|
||||
-
|
||||
!record {model: account.account.type, id: account_account_type_view0}:
|
||||
close_method: none
|
||||
code: View
|
||||
name: View
|
||||
sign: 1
|
||||
|
||||
|
||||
-
|
||||
Creating an account.account.type record
|
||||
-
|
||||
!record {model: account.account.type, id: account_account_type_income0}:
|
||||
close_method: unreconciled
|
||||
code: Income
|
||||
name: Income
|
||||
sign: 1
|
||||
|
||||
|
||||
-
|
||||
Creating an account.account.type record
|
||||
-
|
||||
!record {model: account.account.type, id: account_account_type_expense0}:
|
||||
close_method: unreconciled
|
||||
code: Expense
|
||||
name: Expense
|
||||
sign: 1
|
||||
|
||||
|
||||
-
|
||||
Creating an account.account.type record
|
||||
-
|
||||
!record {model: account.account.type, id: account_account_type_cash0}:
|
||||
close_method: balance
|
||||
code: Cash
|
||||
name: Cash
|
||||
sign: 1
|
||||
|
||||
|
||||
-
|
||||
Creating an account.account record
|
||||
-
|
||||
!record {model: account.account, id: account_account_minimalchart0}:
|
||||
code: '0'
|
||||
company_id: base.main_company
|
||||
currency_mode: current
|
||||
name: Minimal Chart
|
||||
parent_left: 1
|
||||
parent_right: 12
|
||||
type: view
|
||||
user_type: account_account_type_view0
|
||||
-
|
||||
Creating an account.account record
|
||||
-
|
||||
!record {model: account.account, id: account_account_payable1}:
|
||||
code: AP
|
||||
company_id: base.main_company
|
||||
currency_mode: current
|
||||
name: Payable
|
||||
parent_id: account_account_minimalchart0
|
||||
parent_left: 2
|
||||
parent_right: 3
|
||||
reconcile: true
|
||||
type: payable
|
||||
user_type: account_account_type_expense0
|
||||
|
||||
|
||||
-
|
||||
Creating an account.account record
|
||||
-
|
||||
!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
|
||||
parent_left: 4
|
||||
parent_right: 5
|
||||
reconcile: true
|
||||
type: receivable
|
||||
user_type: account_account_type_income0
|
||||
|
||||
|
||||
-
|
||||
Creating an account.account record
|
||||
-
|
||||
!record {model: account.account, id: account_account_cash0}:
|
||||
code: C
|
||||
company_id: base.main_company
|
||||
currency_mode: current
|
||||
name: Cash
|
||||
parent_id: account_account_minimalchart0
|
||||
parent_left: 6
|
||||
parent_right: 7
|
||||
type: other
|
||||
user_type: account_account_type_cash0
|
||||
|
||||
|
||||
-
|
||||
Creating an account.account record
|
||||
-
|
||||
!record {model: account.account, id: account_account_purchases0}:
|
||||
code: P
|
||||
company_id: base.main_company
|
||||
currency_mode: current
|
||||
name: Purchases
|
||||
parent_id: account_account_minimalchart0
|
||||
parent_left: 8
|
||||
parent_right: 9
|
||||
type: other
|
||||
user_type: account_account_type_expense0
|
||||
-
|
||||
Creating an account.account record
|
||||
-
|
||||
!record {model: account.account, id: account_account_sales0}:
|
||||
code: S
|
||||
company_id: base.main_company
|
||||
currency_mode: current
|
||||
name: Sales
|
||||
parent_id: account_account_minimalchart0
|
||||
parent_left: 10
|
||||
parent_right: 11
|
||||
type: other
|
||||
user_type: account_account_type_income0
|
||||
|
||||
|
||||
-
|
||||
Creating an account.journal record
|
||||
-
|
||||
!record {model: account.journal, id: account_journal_purchasejournal0}:
|
||||
code: PUJ
|
||||
company_id: base.main_company
|
||||
default_credit_account_id: account_account_purchases0
|
||||
default_debit_account_id: account_account_purchases0
|
||||
name: Purchase Journal
|
||||
sequence_id: account.sequence_purchase_journal
|
||||
type: purchase
|
||||
view_id: account.account_journal_view
|
||||
|
||||
|
||||
-
|
||||
Creating an account.journal record
|
||||
-
|
||||
!record {model: account.journal, id: account_journal_salejournal0}:
|
||||
code: SAJ
|
||||
company_id: base.main_company
|
||||
default_credit_account_id: account_account_sales0
|
||||
default_debit_account_id: account_account_sales0
|
||||
name: Sale Journal
|
||||
sequence_id: account.sequence_sale_journal
|
||||
type: sale
|
||||
view_id: account.account_journal_view
|
||||
|
||||
|
||||
-
|
||||
Creating an account.journal record
|
||||
-
|
||||
!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
|
||||
|
||||
|
||||
-
|
||||
Creating a ir.property record
|
||||
-
|
||||
!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
|
||||
|
||||
|
||||
-
|
||||
Creating a ir.property record
|
||||
-
|
||||
!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
|
||||
-
|
||||
Creating a res.partner.category record
|
||||
-
|
||||
!record {model: res.partner.category, id: res_partner_category_customers0}:
|
||||
name: Customers
|
||||
-
|
||||
Creating an res.partner record
|
||||
-
|
||||
!record {model: res.partner, id: res_partner_cleartrail0}:
|
||||
category_id:
|
||||
- res_partner_category_customers0
|
||||
name: Cleartrail
|
||||
|
||||
|
||||
-
|
||||
Creating an res.partner.address record
|
||||
-
|
||||
!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
|
||||
|
||||
|
||||
-
|
||||
Creating an res.partner.address record
|
||||
-
|
||||
!record {model: res.partner.address, id: res_partner_address_2}:
|
||||
partner_id: res_partner_cleartrail0
|
||||
type: invoice
|
||||
|
||||
|
||||
-
|
||||
Creating an res.partner.address record
|
||||
-
|
||||
!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 requirements regarding the stockable products
|
||||
-
|
||||
Creating an product.category record
|
||||
-
|
||||
!record {model: product.category, id: product_category_allproductssellable0}:
|
||||
name: Mobile Products Sellable
|
||||
|
||||
|
||||
-
|
||||
Creating an product.category record
|
||||
-
|
||||
!record {model: product.category, id: product_category_services0}:
|
||||
name: Mobile Services
|
||||
-
|
||||
Creating an product.template record
|
||||
-
|
||||
!record {model: product.template, id: product_template_lgviewtysmart0}:
|
||||
categ_id: product_category_allproductssellable0
|
||||
cost_method: standard
|
||||
list_price: 170.0
|
||||
mes_type: fixed
|
||||
name: LG Viewty Smart
|
||||
procure_method: make_to_order
|
||||
standard_price: 160.0
|
||||
supply_method: produce
|
||||
type: product
|
||||
uom_id: product.product_uom_unit
|
||||
uom_po_id: product.product_uom_unit
|
||||
|
||||
-
|
||||
Creating an product.product record
|
||||
-
|
||||
!record {model: product.product, id: product_product_lgviewtysmart0}:
|
||||
categ_id: product_category_allproductssellable0
|
||||
cost_method: standard
|
||||
list_price: 170.0
|
||||
mes_type: fixed
|
||||
name: LG Viewty Smart
|
||||
pricelist_purchase: 'Default Purchase Pricelist (0.00) : 160.00\n'
|
||||
pricelist_sale: 'Public Pricelist (0.00) : 170.00\n'
|
||||
procure_method: make_to_order
|
||||
property_account_expense: sale.account_account_payable1
|
||||
property_account_income: sale.account_account_receivable0
|
||||
seller_delay: '1'
|
||||
standard_price: 160.0
|
||||
supply_method: produce
|
||||
type: product
|
||||
uom_id: product.product_uom_unit
|
||||
uom_po_id: product.product_uom_unit
|
||||
-
|
||||
Creating a sale.order record
|
||||
-
|
||||
!record {model: sale.order, id: sale_order_so0}:
|
||||
date_order: '2010-05-03'
|
||||
invoice_quantity: order
|
||||
name: SO004
|
||||
order_line:
|
||||
- name: LG Viewty Smart
|
||||
price_unit: 170.0
|
||||
product_uom: product.product_uom_unit
|
||||
product_uom_qty: 500.0
|
||||
state: draft
|
||||
delay: 7.0
|
||||
product_id: sale.product_product_lgviewtysmart0
|
||||
product_uos_qty: 500.0
|
||||
th_weight: 0.0
|
||||
type: make_to_order
|
||||
order_policy: prepaid
|
||||
partner_id: sale.res_partner_cleartrail0
|
||||
partner_invoice_id: sale.res_partner_address_2
|
||||
partner_order_id: sale.res_partner_address_1
|
||||
partner_shipping_id: sale.res_partner_address_3
|
||||
picking_policy: direct
|
||||
pricelist_id: product.list0
|
||||
shop_id: sale.shop
|
||||
|
||||
-
|
||||
Creating a sale.advance.payment.inv record
|
||||
-
|
||||
!record {model: sale.advance.payment.inv, id: sale_advance_payment_inv_0}:
|
||||
amount: 1000.0
|
||||
product_id: product.product_product_pc3
|
||||
qtty: 3.0
|
||||
|
||||
|
||||
-
|
||||
Performing an osv_memory action create_invoices on module sale.advance.payment.inv
|
||||
-
|
||||
!python {model: sale.advance.payment.inv}: |
|
||||
self.create_invoices(cr, uid, [ref("sale_advance_payment_inv_0")], {"lang": 'en_US',
|
||||
"active_model": 'sale.order', "active_ids": [ref("sale_order_so0")], "tz":
|
||||
False, "active_id": ref("sale_order_so0"), })
|
||||
-
|
||||
I will verify whether the invoice has been generated for SO since Shipping policy is 'Payment Before Delivery'
|
||||
-
|
||||
!python {model: sale.order}: |
|
||||
so = self.browse(cr, uid, ref("sale_order_so0"))
|
||||
assert so.invoice_ids, "Invoices has not been generated for sale_order_so0"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user