Odoo Help


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

on 7/5/15, 9:32 AM 2,468 views


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


Anil R. Kesariya

--Anil R. Kesariya--
| 6 5 8
Rajkot, India
--Anil R. Kesariya--

Odoo Techno Functional Expert

* Engaged with odoo since May - 2012.

* Customise existing module or develop new module base on customer requirement.

* Played key developer role in many past and running projects.

* Expert in requirement gathering of business and transforming requirement into odoo platform.

* Major expertise in core modules, database, report development and theme development.

* Integration expert.

Linkedin  : https://in.linkedin.com/in/anil-kesariya-97b20a66

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.



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

on 7/6/15, 2:05 AM

Thanks Anil, your answer was helpful :)

on 7/7/15, 2:20 AM


| 6 5 7
Lodz, Poland

On 7/5/15, 3:23 PM

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

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

About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


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