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
|Asked: 5/23/13, 12:06 PM|
|Seen: 2160 times|
|Last updated: 3/16/15, 8:10 AM|