Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Where sale.order.line is moved to stock.move?

By
dirtyHandsPHP
on 7/5/15, 9:32 AM 1,194 views

Hi,

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!!

1

Anil R. Kesariya

--Anil R. Kesariya--
4321
| 6 5 8
Gandhinagar, India
--Anil R. Kesariya--
ERP Consultant

Key Skill
-
Technical & Functional Expert
Anil R. Kesariya
On 7/6/15, 1:44 AM

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 :

stock_move_obj self.pool.get('stock.move')
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.

Rgds,

Anil.


Thanks Anil...This question was for just a reference. The problem is, I have products where I don't even select a product and only description is there. So when i confirm sales order -> Confirm Availablility -> Transfer and the create invoice my sequence is distorted because product related data is coming through stock move but only description related data is coming from sale.order.line. Want to know how Create Invoice is calling two functions separately....one for products selected and other only for description items.....Thanks in advance

dirtyHandsPHP
on 7/6/15, 2:05 AM

Thanks Anil, your answer was helpful :)

dirtyHandsPHP
on 7/7/15, 2:20 AM
1

zbik

--zbik--
5941
| 6 4 7
Lodz, Poland
--zbik--


zbik
On 7/5/15, 3:23 PM

Sale order -> create -> Procuremet ->. create -> Stock move

See: module stock, file procurement.py, method _run_move_create

Your Answer

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

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 7/5/15, 9:32 AM
Seen: 1194 times
Last updated: 7/7/15, 2:19 AM