2010-10-08 10:58:14 +00:00
|
|
|
-
|
|
|
|
In order to test the product pushed flow , I create account ,partner,product,shipment
|
|
|
|
Push flow specification indicates which location is chained with which location.
|
|
|
|
-
|
|
|
|
I create Supplier.
|
2011-01-05 05:03:29 +00:00
|
|
|
-
|
2010-10-08 10:58:14 +00:00
|
|
|
!record {model: res.partner, id: res_partner_microlinktechnologies0}:
|
2012-03-21 12:07:42 +00:00
|
|
|
street: Kailash Vaibhav, Parksite
|
2010-10-08 10:58:14 +00:00
|
|
|
name: Micro Link Technologies
|
2013-05-17 14:58:20 +00:00
|
|
|
property_account_payable: account.a_pay
|
|
|
|
property_account_receivable: account.a_recv
|
2011-01-05 05:03:29 +00:00
|
|
|
supplier: true
|
2012-03-21 12:07:42 +00:00
|
|
|
is_company: true
|
2011-01-05 05:03:29 +00:00
|
|
|
|
2010-10-08 10:58:14 +00:00
|
|
|
-
|
|
|
|
I create Supplier address.
|
2011-01-05 05:03:29 +00:00
|
|
|
-
|
2012-03-21 12:07:42 +00:00
|
|
|
!record {model: res.partner, id: res_partner_address_0}:
|
|
|
|
name: Micro Link Technologies
|
2010-10-08 10:58:14 +00:00
|
|
|
country_id: base.in
|
2012-03-21 12:07:42 +00:00
|
|
|
parent_id: res_partner_microlinktechnologies0
|
2010-10-08 10:58:14 +00:00
|
|
|
street: Ash House, Ash Road
|
|
|
|
title: base.res_partner_title_miss
|
2011-01-05 05:03:29 +00:00
|
|
|
|
2010-10-08 10:58:14 +00:00
|
|
|
-
|
|
|
|
I create product and define the pushed flow .
|
|
|
|
-
|
|
|
|
I set the chain location Supplier to stock Input
|
2011-01-05 05:03:29 +00:00
|
|
|
Stock Input to Quality test and Quality test -Stock .
|
|
|
|
-
|
2011-08-04 13:17:05 +00:00
|
|
|
!record {model: product.product, id: product_product_hpcdwriters01}:
|
2010-10-08 10:58:14 +00:00
|
|
|
list_price: 1000.0
|
|
|
|
mes_type: fixed
|
|
|
|
name: HP CD writers
|
|
|
|
seller_ids:
|
|
|
|
- delay: 1
|
2010-10-08 11:39:47 +00:00
|
|
|
name: res_partner_microlinktechnologies0
|
2010-10-08 10:58:14 +00:00
|
|
|
min_qty: 5.0
|
2013-07-22 14:37:47 +00:00
|
|
|
route_ids:
|
|
|
|
- push_ids:
|
|
|
|
- invoice_state: none
|
|
|
|
location_dest_id: stock_location.stock_location_qualitytest0
|
|
|
|
location_from_id: stock.stock_location_stock
|
|
|
|
- invoice_state: none
|
|
|
|
location_dest_id: stock.stock_location_components
|
|
|
|
location_from_id: stock_location.stock_location_qualitytest0
|
2010-10-08 10:58:14 +00:00
|
|
|
supply_method: buy
|
|
|
|
type: product
|
|
|
|
uom_id: product.product_uom_unit
|
|
|
|
uom_po_id: product.product_uom_unit
|
|
|
|
property_stock_inventory: stock.location_inventory
|
|
|
|
property_stock_procurement: stock.location_procurement
|
|
|
|
property_stock_production: stock.location_production
|
|
|
|
-
|
|
|
|
In order to test pushed flow .I buy the product from Micro Link Technologies supplier. I create a Picking.
|
2011-01-05 05:03:29 +00:00
|
|
|
-
|
2010-10-08 10:58:14 +00:00
|
|
|
!record {model: stock.picking , id: stock_picking_in0}:
|
2012-03-30 08:11:36 +00:00
|
|
|
partner_id: res_partner_address_0
|
2010-10-08 10:58:14 +00:00
|
|
|
company_id: base.main_company
|
|
|
|
invoice_state: none
|
|
|
|
move_lines:
|
2011-01-05 05:03:29 +00:00
|
|
|
- date_expected: !eval time.strftime('%Y-%m-%d %H:%M:%S')
|
2010-10-11 21:57:06 +00:00
|
|
|
location_dest_id: stock.stock_location_stock
|
2010-10-08 10:58:14 +00:00
|
|
|
location_id: stock.stock_location_suppliers
|
|
|
|
name: 'HP CD writers'
|
2011-08-04 13:17:05 +00:00
|
|
|
product_id: product_product_hpcdwriters01
|
2013-06-30 14:10:14 +00:00
|
|
|
product_uom_qty: 6.0
|
2010-10-08 10:58:14 +00:00
|
|
|
product_uom: product.product_uom_unit
|
|
|
|
product_uos_qty: 6.0
|
|
|
|
name: Pushed Flow Test
|
|
|
|
type: in
|
|
|
|
-
|
2011-01-05 05:03:29 +00:00
|
|
|
I confirm picking.
|
2010-10-08 10:58:14 +00:00
|
|
|
-
|
|
|
|
!python {model: stock.picking }: |
|
|
|
|
self.draft_force_assign(cr, uid, [ref("stock_picking_in0")], {"lang": "en_US",
|
|
|
|
"search_default_available": 1, "tz": False, "active_model": "ir.ui.menu",
|
|
|
|
"contact_display": "partner_address", "active_ids": [ref("stock.menu_action_picking_tree4")],
|
|
|
|
"active_id": ref("stock.menu_action_picking_tree4"), })
|
|
|
|
-
|
|
|
|
I check that the outgoing order of the supplier is create with two move line.
|
2010-10-08 11:57:11 +00:00
|
|
|
Stock/Input To Quality test and Quality test To Stock.
|
|
|
|
-
|
2010-10-08 10:58:14 +00:00
|
|
|
I check the move is in waiting state.
|
2011-01-05 05:03:29 +00:00
|
|
|
-
|
2010-10-08 10:58:14 +00:00
|
|
|
!python {model: stock.picking }: |
|
|
|
|
picking_id = self.search(cr, uid, [('origin','=','Pushed Flow Test'),('type','=','out')])
|
|
|
|
if picking_id:
|
|
|
|
pick=self.browse(cr,uid,picking_id[0])
|
|
|
|
for move in pick.move_lines:
|
2013-03-21 13:18:24 +00:00
|
|
|
assert(move.state == 'waiting'), 'Stock is not in waiting state'
|
2010-10-08 10:58:14 +00:00
|
|
|
-
|
2010-10-08 11:39:47 +00:00
|
|
|
I receive the order of the supplier Micro Link Technologies from the Incoming Shipments menu.
|
2010-10-08 10:58:14 +00:00
|
|
|
-
|
|
|
|
!python {model: stock.picking }: |
|
|
|
|
import time
|
2012-03-30 08:49:51 +00:00
|
|
|
picking_id = self.search(cr, uid, [('partner_id','=',ref('res_partner_microlinktechnologies0')),('type','=','in')])
|
2010-10-08 10:58:14 +00:00
|
|
|
if picking_id:
|
|
|
|
pick=self.browse(cr,uid,picking_id[0])
|
|
|
|
move =pick.move_lines[0]
|
|
|
|
partial_datas = {
|
2012-03-30 08:49:51 +00:00
|
|
|
'partner_id':pick.partner_id,
|
2010-10-08 10:58:14 +00:00
|
|
|
'delivery_date' : time.strftime('%Y-%m-%d'),
|
|
|
|
}
|
|
|
|
partial_datas['move%s'%(move.id)]= {
|
|
|
|
'product_id': move.product_id.id,
|
|
|
|
'product_qty': move.product_qty,
|
|
|
|
'product_uom': move.product_uom.id,
|
2011-01-05 05:03:29 +00:00
|
|
|
}
|
|
|
|
self.do_partial(cr, uid, picking_id,partial_datas)
|
2010-10-08 10:58:14 +00:00
|
|
|
-
|
|
|
|
I check the Outgoing Orders is automatically done.
|
2011-01-05 05:03:29 +00:00
|
|
|
-
|
2010-10-08 10:58:14 +00:00
|
|
|
!python {model: stock.picking }: |
|
|
|
|
picking_id = self.search(cr, uid, [('origin','=','Pushed Flow Test'),('type','=','out')])
|
|
|
|
if picking_id:
|
|
|
|
pick=self.browse(cr,uid,picking_id[0])
|
2013-03-21 13:18:24 +00:00
|
|
|
assert(pick.state == 'done'), 'Picking is not in done state'
|