[IMP] improved according to new wms
bzr revid: bde@tinyerp.com-20130819060609-blgi8tornvbfztg4
This commit is contained in:
@@ -31,15 +31,15 @@
|
||||
from openerp.tools import DEFAULT_SERVER_DATE_FORMAT, DEFAULT_SERVER_DATETIME_FORMAT
|
||||
order = self.browse(cr, uid, ref("sale.sale_order_6"))
|
||||
for order_line in order.order_line:
|
||||
procurement = order_line.procurement_id
|
||||
sale_order_date = self.date_to_datetime(cr, uid, order.date_order, context)
|
||||
date_planned = datetime.strptime(sale_order_date, DEFAULT_SERVER_DATETIME_FORMAT) + relativedelta(days=order_line.delay or 0.0)
|
||||
procurements = order_line.procurement_ids
|
||||
date_planned = datetime.strptime(order.date_order, DEFAULT_SERVER_DATETIME_FORMAT) + relativedelta(days=order_line.delay or 0.0)
|
||||
date_planned = (date_planned - timedelta(days=order.company_id.security_lead)).strftime(DEFAULT_SERVER_DATETIME_FORMAT)
|
||||
assert procurement.date_planned == date_planned, "Scheduled date is not correspond."
|
||||
assert procurement.product_id.id == order_line.product_id.id, "Product is not correspond."
|
||||
assert procurement.product_qty == order_line.product_uom_qty, "Qty is not correspond."
|
||||
assert procurement.product_uom.id == order_line.product_uom.id, "UOM is not correspond."
|
||||
assert procurement.procure_method == order_line.type, "Procurement method is not correspond."
|
||||
for procurement in procurements:
|
||||
assert procurement.date_planned == date_planned, "Scheduled date is not correspond."
|
||||
assert procurement.product_id.id == order_line.product_id.id, "Product is not correspond."
|
||||
assert procurement.product_qty == order_line.product_uom_qty, "Qty is not correspond."
|
||||
assert procurement.product_uom.id == order_line.product_uom.id, "UOM is not correspond."
|
||||
assert procurement.move_dest_id.procure_method == order_line.type, "Procurement method is not correspond."
|
||||
-
|
||||
I run the scheduler.
|
||||
-
|
||||
@@ -57,7 +57,7 @@
|
||||
for picking in sale_order.picking_ids:
|
||||
assert picking.state == "auto" or "confirmed", "Delivery order should be in 'Waitting Availability' state."
|
||||
assert picking.origin == sale_order.name,"Origin of Delivery order is not correspond with sequence number of sale order."
|
||||
assert picking.type == 'out',"Shipment should be Outgoing."
|
||||
assert picking.picking_type_id == self.pool.get('ir.model.data').get_object(cr, uid, 'stock', 'picking_type_out', context=context),"Shipment should be Outgoing."
|
||||
assert picking.move_type == sale_order.picking_policy,"Delivery Method is not corresponding with delivery method of sale order."
|
||||
assert picking.partner_id.id == sale_order.partner_shipping_id.id,"Shipping Address is not correspond with sale order."
|
||||
assert picking.note == sale_order.note,"Note is not correspond with sale order."
|
||||
@@ -66,7 +66,7 @@
|
||||
location_id = sale_order.warehouse_id.lot_stock_id.id
|
||||
output_id = sale_order.warehouse_id.lot_output_id.id
|
||||
for move in picking.move_lines:
|
||||
order_line = move.sale_line_id
|
||||
order_line = move.procurement_id.sale_line_id
|
||||
sale_order_date = self.date_to_datetime(cr, uid, sale_order.date_order, context)
|
||||
date_planned = datetime.strptime(sale_order_date, DEFAULT_SERVER_DATETIME_FORMAT) + relativedelta(days=order_line.delay or 0.0)
|
||||
date_planned = (date_planned - timedelta(days=sale_order.company_id.security_lead)).strftime(DEFAULT_SERVER_DATETIME_FORMAT)
|
||||
@@ -84,13 +84,12 @@
|
||||
-
|
||||
Now, I dispatch delivery order.
|
||||
-
|
||||
!python {model: stock.partial.picking}: |
|
||||
!python {model: stock.picking}: |
|
||||
order = self.pool.get('sale.order').browse(cr, uid, ref("sale.sale_order_6"))
|
||||
for pick in order.picking_ids:
|
||||
data = pick.force_assign()
|
||||
if data == True:
|
||||
partial_id = self.create(cr, uid, {}, context={'active_model': 'stock.picking','active_ids': [pick.id]})
|
||||
self.do_partial(cr, uid, [partial_id])
|
||||
pick.do_partial(context=context)
|
||||
-
|
||||
I check sale order to verify shipment.
|
||||
-
|
||||
|
||||
Reference in New Issue
Block a user