2 In order to test the product pushed flow , I create account ,partner,product,shipment
3 Push flow specification indicates which location is chained with which location.
5 I create product category.
7 !record {model: product.category, id: product_category_computer0}:
13 !record {model: res.partner, id: res_partner_microlinktechnologies0}:
15 - street: Kailash Vaibhav, Parksite
16 name: Micro Link Technologies
17 property_account_payable: account_account_payable0
18 property_account_receivable: account_account_receivable0
22 I create Supplier address.
24 !record {model: res.partner.address, id: res_partner_address_0}:
26 partner_id: res_partner_microlinktechnologies0
27 street: Ash House, Ash Road
28 title: base.res_partner_title_miss
31 I create product and define the pushed flow .
33 I set the chain location Supplier to stock Input
34 Stock Input to Quality test and Quality test -Stock .
36 !record {model: product.product, id: product_product_hpcdwriters01}:
37 categ_id: product_category_computer0
42 procure_method: make_to_stock
45 name: res_partner_microlinktechnologies0
50 location_dest_id: stock_location.stock_location_qualitytest0
51 location_from_id: stock.stock_location_stock
54 location_dest_id: stock.stock_location_components
55 location_from_id: stock_location.stock_location_qualitytest0
58 uom_id: product.product_uom_unit
59 uom_po_id: product.product_uom_unit
60 property_stock_inventory: stock.location_inventory
61 property_stock_procurement: stock.location_procurement
62 property_stock_production: stock.location_production
64 In order to test pushed flow .I buy the product from Micro Link Technologies supplier. I create a Picking.
66 !record {model: stock.picking , id: stock_picking_in0}:
67 address_id: res_partner_address_0
68 company_id: base.main_company
71 - date_expected: !eval time.strftime('%Y-%m-%d %H:%M:%S')
72 location_dest_id: stock.stock_location_stock
73 location_id: stock.stock_location_suppliers
75 product_id: product_product_hpcdwriters01
77 product_uom: product.product_uom_unit
79 name: Pushed Flow Test
84 !python {model: stock.picking }: |
85 self.draft_force_assign(cr, uid, [ref("stock_picking_in0")], {"lang": "en_US",
86 "search_default_available": 1, "tz": False, "active_model": "ir.ui.menu",
87 "contact_display": "partner_address", "active_ids": [ref("stock.menu_action_picking_tree4")],
88 "active_id": ref("stock.menu_action_picking_tree4"), })
90 I check that the outgoing order of the supplier is create with two move line.
91 Stock/Input To Quality test and Quality test To Stock.
93 I check the move is in waiting state.
95 !python {model: stock.picking }: |
96 from tools.translate import _
97 picking_id = self.search(cr, uid, [('origin','=','Pushed Flow Test'),('type','=','out')])
99 pick=self.browse(cr,uid,picking_id[0])
100 for move in pick.move_lines:
101 assert(move.state == 'waiting'), _('Stock is not in waiting state')
103 I receive the order of the supplier Micro Link Technologies from the Incoming Shipments menu.
105 !python {model: stock.picking }: |
107 picking_id = self.search(cr, uid, [('address_id.partner_id','=',ref('res_partner_microlinktechnologies0')),('type','=','in')])
109 pick=self.browse(cr,uid,picking_id[0])
110 move =pick.move_lines[0]
112 'partner_id':pick.address_id.partner_id.id,
113 'address_id': pick.address_id.id,
114 'delivery_date' : time.strftime('%Y-%m-%d'),
116 partial_datas['move%s'%(move.id)]= {
117 'product_id': move.product_id.id,
118 'product_qty': move.product_qty,
119 'product_uom': move.product_uom.id,
121 self.do_partial(cr, uid, picking_id,partial_datas)
123 I check the Outgoing Orders is automatically done.
125 !python {model: stock.picking }: |
126 from tools.translate import _
127 picking_id = self.search(cr, uid, [('origin','=','Pushed Flow Test'),('type','=','out')])
129 pick=self.browse(cr,uid,picking_id[0])
130 assert(pick.state == 'done'), _('Picking is not in done state')