2010-10-08 10:58:14 +00:00
|
|
|
-
|
2011-01-05 05:03:29 +00:00
|
|
|
In order to test the product pulled flow , I create ,partner,product,procurement
|
|
|
|
-
|
2010-10-08 10:58:14 +00:00
|
|
|
I create a account type Asset.
|
2011-01-05 05:03:29 +00:00
|
|
|
-
|
2010-10-08 10:58:14 +00:00
|
|
|
!record {model: account.account.type, id: account_account_type_asset0}:
|
|
|
|
close_method: balance
|
2010-10-13 22:00:42 +00:00
|
|
|
code: asset_test
|
|
|
|
name: Asset For Tests
|
2011-01-05 05:03:29 +00:00
|
|
|
-
|
2010-10-08 10:58:14 +00:00
|
|
|
I create a account type income.
|
2011-01-05 05:03:29 +00:00
|
|
|
-
|
2010-10-08 10:58:14 +00:00
|
|
|
!record {model: account.account.type, id: account_account_type_income0}:
|
|
|
|
close_method: unreconciled
|
2010-10-13 22:00:42 +00:00
|
|
|
code: income_test
|
|
|
|
name: Income For Tests
|
2011-01-05 05:03:29 +00:00
|
|
|
-
|
2010-10-08 10:58:14 +00:00
|
|
|
I create a account type Expense.
|
2011-01-05 05:03:29 +00:00
|
|
|
-
|
2010-10-08 10:58:14 +00:00
|
|
|
!record {model: account.account.type, id: account_account_type_expense0}:
|
|
|
|
close_method: unreconciled
|
2010-10-13 22:00:42 +00:00
|
|
|
code: expense_test
|
|
|
|
name: Expense For Tests
|
2011-01-05 05:03:29 +00:00
|
|
|
-
|
2010-10-08 10:58:14 +00:00
|
|
|
I create a account type Receivable.
|
2011-01-05 05:03:29 +00:00
|
|
|
-
|
2010-10-08 10:58:14 +00:00
|
|
|
!record {model: account.account.type, id: account_account_type_receivable0}:
|
2011-09-22 11:11:11 +00:00
|
|
|
close_method: unreconciled
|
2010-10-13 22:00:42 +00:00
|
|
|
code: receivable_test
|
|
|
|
name: Receivable For Tests
|
2010-10-08 10:58:14 +00:00
|
|
|
-
|
2011-01-05 05:03:29 +00:00
|
|
|
|
2010-10-08 10:58:14 +00:00
|
|
|
I create a account Receivable.
|
2011-01-05 05:03:29 +00:00
|
|
|
-
|
2010-10-08 10:58:14 +00:00
|
|
|
!record {model: account.account, id: account_account_receivable0}:
|
2010-10-13 22:00:42 +00:00
|
|
|
code: 40000_test
|
2010-10-08 10:58:14 +00:00
|
|
|
company_id: base.main_company
|
|
|
|
currency_mode: current
|
2010-10-13 22:00:42 +00:00
|
|
|
name: Receivable For Tests
|
2010-10-08 10:58:14 +00:00
|
|
|
type: receivable
|
|
|
|
user_type: account_account_type_receivable0
|
2011-01-05 05:03:29 +00:00
|
|
|
-
|
2010-10-08 10:58:14 +00:00
|
|
|
I create a account Payable.
|
2011-01-05 05:03:29 +00:00
|
|
|
-
|
2010-10-08 10:58:14 +00:00
|
|
|
!record {model: account.account, id: account_account_payable0}:
|
2010-10-13 22:00:42 +00:00
|
|
|
code: 440000_test
|
2010-10-08 10:58:14 +00:00
|
|
|
company_id: base.main_company
|
|
|
|
currency_mode: current
|
2010-10-13 22:00:42 +00:00
|
|
|
name: Payable For Tests
|
2010-10-08 10:58:14 +00:00
|
|
|
type: payable
|
2011-01-05 05:03:29 +00:00
|
|
|
user_type: account_account_type_expense0
|
|
|
|
-
|
2010-10-08 10:58:14 +00:00
|
|
|
I create a Purchase Journal.
|
2011-01-05 05:03:29 +00:00
|
|
|
-
|
2010-10-08 10:58:14 +00:00
|
|
|
!record {model: account.journal, id: account_journal_purchasejournal0}:
|
2010-10-13 22:00:42 +00:00
|
|
|
code: pur_test
|
2010-10-08 10:58:14 +00:00
|
|
|
company_id: base.main_company
|
2010-10-13 22:00:42 +00:00
|
|
|
name: Purchase Journal For Tests
|
2010-10-08 10:58:14 +00:00
|
|
|
sequence_id: account.sequence_purchase_journal
|
|
|
|
type: purchase
|
2011-01-05 05:03:29 +00:00
|
|
|
|
|
|
|
-
|
2010-10-08 10:58:14 +00:00
|
|
|
I create a Sale Journal.
|
2011-01-05 05:03:29 +00:00
|
|
|
-
|
2010-10-08 10:58:14 +00:00
|
|
|
!record {model: account.journal, id: account_journal_salejouran0}:
|
2010-10-13 22:00:42 +00:00
|
|
|
code: sal_test
|
2010-10-08 10:58:14 +00:00
|
|
|
company_id: base.main_company
|
2010-10-13 22:00:42 +00:00
|
|
|
name: Sale Journal For Tests
|
2010-10-08 10:58:14 +00:00
|
|
|
sequence_id: account.sequence_sale_journal
|
|
|
|
type: sale
|
2011-01-05 05:03:29 +00:00
|
|
|
|
|
|
|
-
|
2010-10-13 22:00:42 +00:00
|
|
|
I create an Expense Account
|
2011-01-05 05:03:29 +00:00
|
|
|
-
|
2010-10-08 10:58:14 +00:00
|
|
|
!record {model: account.account, id: account_account_expenseaccount0}:
|
2010-10-13 22:00:42 +00:00
|
|
|
code: Expe_test
|
2010-10-08 10:58:14 +00:00
|
|
|
company_id: base.main_company
|
|
|
|
currency_mode: current
|
2010-10-13 22:00:42 +00:00
|
|
|
name: Expense Account For Tests
|
2010-10-08 10:58:14 +00:00
|
|
|
type: consolidation
|
|
|
|
user_type: account_account_type_asset0
|
2011-01-05 05:03:29 +00:00
|
|
|
-
|
2010-10-08 10:58:14 +00:00
|
|
|
I create Product Sale account.
|
2011-01-05 05:03:29 +00:00
|
|
|
-
|
2010-10-08 10:58:14 +00:00
|
|
|
!record {model: account.account, id: account_account_productsale0}:
|
2010-10-13 22:00:42 +00:00
|
|
|
code: 001_test
|
2010-10-08 10:58:14 +00:00
|
|
|
company_id: base.main_company
|
|
|
|
currency_mode: current
|
2010-10-13 22:00:42 +00:00
|
|
|
name: Product Sale For Tests
|
2010-10-08 10:58:14 +00:00
|
|
|
type: other
|
|
|
|
user_type: account_account_type_income0
|
|
|
|
|
2011-01-05 05:03:29 +00:00
|
|
|
-
|
2010-10-08 10:58:14 +00:00
|
|
|
I create Product Product Purchase.
|
2011-01-05 05:03:29 +00:00
|
|
|
-
|
2010-10-08 10:58:14 +00:00
|
|
|
!record {model: account.account, id: account_account_productpurchase0}:
|
2010-10-13 22:00:42 +00:00
|
|
|
code: 0002_test
|
2010-10-08 10:58:14 +00:00
|
|
|
company_id: base.main_company
|
|
|
|
currency_mode: current
|
2010-10-13 22:00:42 +00:00
|
|
|
name: Product Purchase For Tests
|
2010-10-08 10:58:14 +00:00
|
|
|
type: other
|
|
|
|
user_type: account_account_type_expense0
|
2011-01-05 05:03:29 +00:00
|
|
|
-
|
2010-10-13 22:00:42 +00:00
|
|
|
I create a Supplier.
|
2011-01-05 05:03:29 +00:00
|
|
|
-
|
2010-10-08 10:58:14 +00:00
|
|
|
!record {model: res.partner, id: res_partner_shawtrust0}:
|
2012-03-21 12:07:42 +00:00
|
|
|
name: Shaw Trust
|
2010-10-08 10:58:14 +00:00
|
|
|
lang: en_US
|
2012-03-21 12:07:42 +00:00
|
|
|
country_id: base.in
|
|
|
|
street: St James House, Vicar Lane, Sheffiel
|
2010-10-08 10:58:14 +00:00
|
|
|
property_account_payable: account_account_payable0
|
2011-01-05 05:03:29 +00:00
|
|
|
property_account_receivable: account_account_receivable0
|
|
|
|
-
|
2010-10-13 22:00:42 +00:00
|
|
|
I create a product category.
|
2011-01-05 05:03:29 +00:00
|
|
|
-
|
2010-10-08 10:58:14 +00:00
|
|
|
!record {model: product.category, id: product_category_computer0}:
|
|
|
|
name: Computer
|
|
|
|
-
|
2010-10-13 22:00:42 +00:00
|
|
|
I create a product and define the pulled flow condition for stock move.
|
|
|
|
I set shipping type Sending Goods. and set Procurement type to move.
|
2011-01-05 05:03:29 +00:00
|
|
|
-
|
2011-08-04 13:17:05 +00:00
|
|
|
!record {model: product.product, id: product_product_hpcdwriters01}:
|
2010-10-08 10:58:14 +00:00
|
|
|
categ_id: product_category_computer0
|
|
|
|
cost_method: standard
|
|
|
|
list_price: 1000.0
|
|
|
|
mes_type: fixed
|
|
|
|
name: HP CD writers
|
|
|
|
procure_method: make_to_stock
|
|
|
|
seller_ids:
|
|
|
|
- delay: 1
|
|
|
|
name: res_partner_shawtrust0
|
|
|
|
min_qty: 5.0
|
|
|
|
supply_method: buy
|
|
|
|
type: product
|
|
|
|
uom_id: product.product_uom_unit
|
|
|
|
uom_po_id: product.product_uom_unit
|
|
|
|
property_account_expense: account_account_productpurchase0
|
|
|
|
property_account_income: account_account_productsale0
|
|
|
|
flow_pull_ids:
|
|
|
|
- invoice_state: none
|
|
|
|
location_id: stock.stock_location_shop0
|
|
|
|
location_src_id: stock.stock_location_shop1
|
|
|
|
name: E001
|
|
|
|
partner_address_id: base.res_partner_address_2
|
|
|
|
picking_type: out
|
|
|
|
procure_method: make_to_stock
|
|
|
|
type_proc: move
|
|
|
|
- invoice_state: none
|
|
|
|
location_id: stock.stock_location_shop1
|
|
|
|
location_src_id: stock.stock_location_suppliers
|
|
|
|
name: E002
|
|
|
|
partner_address_id: base.res_partner_address_7
|
|
|
|
picking_type: out
|
|
|
|
procure_method: make_to_stock
|
|
|
|
type_proc: move
|
|
|
|
- invoice_state: none
|
|
|
|
location_id: stock.stock_location_suppliers
|
|
|
|
location_src_id: stock.stock_location_stock
|
|
|
|
name: E003
|
|
|
|
type_proc: buy
|
|
|
|
property_stock_inventory: stock.location_inventory
|
|
|
|
property_stock_procurement: stock.location_procurement
|
|
|
|
property_stock_production: stock.location_production
|
|
|
|
qty_available: 15
|
2011-01-05 05:03:29 +00:00
|
|
|
-
|
2010-10-13 22:00:42 +00:00
|
|
|
I create a procurement order.
|
2011-01-05 05:03:29 +00:00
|
|
|
-
|
2010-10-08 10:58:14 +00:00
|
|
|
!record {model: procurement.order, id: procurement_order_test0}:
|
|
|
|
company_id: base.main_company
|
2011-01-05 05:03:29 +00:00
|
|
|
date_planned: !eval time.strftime('%Y-%m-%d %H:%M:%S')
|
2010-10-08 10:58:14 +00:00
|
|
|
location_id: stock.stock_location_shop0
|
|
|
|
name: Testing pulled flow
|
|
|
|
priority: '1'
|
|
|
|
procure_method: make_to_order
|
2011-08-04 13:17:05 +00:00
|
|
|
product_id: product_product_hpcdwriters01
|
2010-10-08 10:58:14 +00:00
|
|
|
product_qty: 5.0
|
|
|
|
product_uom: product.product_uom_unit
|
|
|
|
product_uos: product.product_uom_unit
|
|
|
|
product_uos_qty: 0.0
|
2011-01-05 05:03:29 +00:00
|
|
|
-
|
2010-10-13 22:00:42 +00:00
|
|
|
I confirm the procurement order.
|
2011-01-05 05:03:29 +00:00
|
|
|
-
|
2010-10-08 10:58:14 +00:00
|
|
|
!workflow {model: procurement.order, action: button_confirm, ref: procurement_order_test0}
|
2011-01-05 05:03:29 +00:00
|
|
|
-
|
2010-10-08 10:58:14 +00:00
|
|
|
I launch the scheduler to compute procurement.
|
2011-01-05 05:03:29 +00:00
|
|
|
-
|
2010-10-08 10:58:14 +00:00
|
|
|
!python {model: procurement.order.compute.all}: |
|
|
|
|
proc_obj = self.pool.get('procurement.order')
|
|
|
|
proc_obj._procure_confirm(cr,uid)
|
2011-08-04 13:17:05 +00:00
|
|
|
|
2010-10-08 10:58:14 +00:00
|
|
|
-
|
2010-10-13 22:00:42 +00:00
|
|
|
I check the new procurement order has been created .
|
2010-10-08 10:58:14 +00:00
|
|
|
-
|
2011-01-05 05:03:29 +00:00
|
|
|
!python {model: procurement.order }: |
|
|
|
|
from tools.translate import _
|
2010-10-08 10:58:14 +00:00
|
|
|
procurement_ids=self.search(cr, uid, [('name','=','E001')])
|
2010-10-13 22:00:42 +00:00
|
|
|
assert len(procurement_ids), "Procurement order hasn't Created."
|
2010-10-08 10:58:14 +00:00
|
|
|
-
|
2012-07-27 12:18:27 +00:00
|
|
|
I check the Outgoing Picking is created for source location Birmingham Shop and destination Chicago shop.
|
2010-10-08 10:58:14 +00:00
|
|
|
-
|
|
|
|
!python {model: stock.picking }: |
|
2011-01-05 05:03:29 +00:00
|
|
|
from tools.translate import _
|
2010-10-08 10:58:14 +00:00
|
|
|
picking_id = self.search(cr, uid, [('origin','=','Testing pulled flow:E001'),('type','=','out')])
|
2010-10-13 22:00:42 +00:00
|
|
|
assert len(picking_id), "Picking hasn't Created."
|