Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
You can simply get category_id in sale.order.line by using
browse method of
sale_order_line in product_id_change method. Just need to pass sale_order_line id in it.
order_line_brw = self.pool.get('sale.order.line').browse(cr, uid, ids, context=context)
order_line_brw = self.browse(cr, uid, ids, context=context)
category_id = order_line_brw.product_id and order_line_brw.product_id.categ_id
This will give you browse record of category if you want category_id then just need to add
.id at the end
category_id = order_line_brw.product_id and order_line_brw.product_id.categ_id.id
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 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.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 5/23/13, 12:06 PM|
|Seen: 2233 times|
|Last updated: 3/16/15, 8:10 AM|