[IMP/ADD]dropship yml improve and add crossdock yml

bzr revid: sgo@tinyerp.com-20130829113013-cqcpzoulg88lbdu2
This commit is contained in:
Sanjay Gohel (OpenERP) 2013-08-29 17:00:13 +05:30
parent 7be335a976
commit 9cd5e3f2f7
4 changed files with 106 additions and 38 deletions

View File

@ -386,6 +386,8 @@ class purchase_order(osv.osv):
'''
This function returns an action that display existing picking orders of given purchase order ids.
'''
if context is None:
context = {}
mod_obj = self.pool.get('ir.model.data')
pick_ids = []
for po in self.browse(cr, uid, ids, context=context):

View File

@ -38,7 +38,11 @@ This adds a route on the sales order and sales order line (mini module)
'init_xml': [],
'update_xml': ['stock_complex_routes.xml'],
'demo_xml': [],
'test': ['test/lifo_price.yml'],
'test': [
'test/crossdock.yml',
'test/dropship.yml',
'test/lifo_price.yml'
],
'installable': True,
'auto_install': True,
}

View File

@ -0,0 +1,38 @@
-
Create new product without any routes
-
!record {model: product.product, id: cross_shop_product}:
name: PCE
type: product
categ_id: product.product_category_1
list_price: 100.0
standard_price: 70.0
seller_ids:
- delay: 1
name: base.res_partner_2
min_qty: 2.0
qty: 5.0
type: product
uom_id: product.product_uom_unit
uom_po_id: product.product_uom_unit
-
Create a sales order with a line of 100 PCE incoming shipment, with route_id crossdock shipping.
-
!record {model: sale.order, id: sale_order_crossdock_shpng}:
partner_id: base.res_partner_4
note: Create Sales order
order_line:
- product_id: cross_shop_product
product_uom_qty: 100.00
route_id: stock_location.route_warehouse0_crossdock
-
Confirm sales order
-
!python {model: sale.order}: |
self.action_button_confirm(cr, uid, [ref('sale_order_crossdock_shpng')])
-
Check a quotation was created to a certain supplier and confirm so it becomes a confirmed purchase order
-
!python {model: purchase.order}: |
po_id = self.search(cr, uid, [('partner_id', '=', ref('base.res_partner_2'))])
self.wkf_confirm_order(cr, uid, po_id)

View File

@ -1,53 +1,77 @@
-
Create new product without any routes
Create new product without any routes
-
!record {model:product.product, id:}
!record {model: product.product, id: drop_shop_product}:
name: Pen drive
type: product
categ_id: product.product_category_1
list_price: 100.0
standard_price: 70.0
seller_ids:
- delay: 1
name: base.res_partner_2
min_qty: 2.0
qty: 5.0
uom_id: product.product_uom_unit
uom_po_id: product.product_uom_unit
-
Create a sales order with a line of 200 PCE incoming shipment, with route_id drop shipping
Create a sales order with a line of 200 PCE incoming shipment, with route_id drop shipping.
-
!record {model: sale.order, id: } :
customer:
- product_id:
product_qty: 200
product_uom:
supplier_ids:
!record {model: sale.order, id: sale_order_drp_shpng}:
partner_id: base.res_partner_2
note: Create sale order for drop shipping
payment_term: account.account_payment_term
order_line:
- product_id: drop_shop_product
product_uom_qty: 200
price_unit: 100.00
route_id: route_drop_shipping
-
Confirm sales order
Confirm sales order
-
!python{model: sale.order}: |
self.browse(cr, uid, ref()).action_b
!workflow {model: sale.order, action: order_confirm, ref: sale_order_drp_shpng}
-
Check the sales order created a procurement group which has a procurement of 200 pieces
Check the sales order created a procurement group which has a procurement of 200 pieces
-
!python{model: procurement.group}: |
proc_group = self.search(cr, uid, [('sale_id', '=', ref())])
assert self.browse(cr, uid, proc_group)[0].procurement_ids[0].product_qty == 200
!python {model: procurement.group}: |
sale_record = self.pool.get("sale.order").browse(cr, uid, ref('sale_order_drp_shpng'))
assert self.browse(cr, uid, sale_record.procurement_group_id.id).procurement_ids[0].product_qty == 200
-
Check a quotation was created to a certain supplier and confirm so it becomes a confirmed purchase order
Check a quotation was created to a certain supplier and confirm so it becomes a confirmed purchase order
-
!python {model: purchase.order}: |
from openerp import netsvc
sale_record = self.pool.get("sale.order").browse(cr, uid, ref('sale_order_drp_shpng'))
procurement_order = self.pool.get("procurement.group").browse(cr, uid, sale_record.procurement_group_id.id).procurement_ids[0]
purchase_id = procurement_order.purchase_id.id
wf_service = netsvc.LocalService('workflow')
wf_service.trg_validate(uid, 'purchase.order', purchase_id, 'purchase_confirm', cr)
-
Use 'Receive Products' button to immediately view this picking, it should have created a picking with 200 pieces..
-
!python {model: purchase.order}: |
po_id = self.search(cr, uid, [('partner_id', '=', ref('base.res_partner_2'))])
picking_id = self.search(cr, uid, [('purchase_id', '=', po_id[0])])
context.update({'active_model': 'stock.picking', 'active_id': backorder_id[0], 'active_ids': backorder_id})
self.view_picking(cr, uid, po_id)
-
Send the 200 pieces.
-
Check the sales order has one picking with 200 pieces
!python {model: stock.picking}: |
po_id = self.pool.get('purchase.order').search(cr, uid, [('partner_id', '=', ref('base.res_partner_2'))])
picking_id = self.search(cr, uid, [('purchase_id', '=', po_id[0])])
self.do_partial(cr, uid, picking_id)
-
!python{model: sale.order}: |
assert len(self.browse(cr, uid, ref()).picking_ids) == 1
Check one quant was created in Customers location with 200 pieces and one move in the history_ids
-
Use 'View Delivery Order' button to immediately view this picking and check shipped of purchase order is False
-
-
Send the 200 pieces
-
!python{model: stock.partial.picking}: |
-
Check one quant was created in Customers location with 200 pieces and one move in the move_history_ids
-
!python {model: stock.quant}: |
quant_id = self.search(cr, uid, [('location_id', '=', ref('stock.stock_location_customers')),('qty', '=', 200)])
assert len(self.browse(cr, uid, quant_id)[0].history_ids) == 1
assert len(quant_id) == 1
-
Check the sum of the moves related to this product and the sum of the quants is equal
-
!python {model: stock.quant}: |
move_ids = self.pool.get('stock.move').search(cr, uid, [('product_id', '=', ref('drop_shop_product'))])
quant_ids = self.search(cr, uid, [('product_id', '=', ref('drop_shop_product'))])
assert len(move_ids) == len(quant_ids)