When I confirm a sales order i can see that my sale.order.line's are moved to stock.move but in code I am not able to see where exactly it is happening. Can anyone please guide or help!!
Hi Shiv Modi,
If you want reference of SO line which is associated with stock move than,
You have to follow this.
1) stock move having reference of procurement when stock move created related procurement record is also created which having the sale order line references.
So, you can not get the sale order line reference directly from stock move.
2) You have do like this,
consider move is browse record of your stock.move
If you have only move_ids than follow this :
sale_lines = [ move.procurement_id.sale_line_id for move in stock_move_obj.browse(cr, uid, move_ids) if move.procurement_id and move.procurement_id.sale_line_id]
print "Browse record of Associated Sale Order LIne",sale_lines
#If you want Sale order line ids only. than
sale_line_ids = [ move.procurement_id.sale_line_id.id for move in stock_move_obj.browse(cr, uid, move_ids) if move.procurement_id and move.procurement_id.sale_line_id]
print " Sale Line IDs:::::",sale_line_ids
Hope this will helps.
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
About This Community
|Asked: 7/5/15, 9:32 AM|
|Seen: 947 times|
|Last updated: 7/7/15, 2:19 AM|