Create pos.order.line with automatic price selection according to product_id and pricelist_id

Asked by codemonk

I need to implement a custom POS interface in our existing POS structure. To do so I use oerplib:

>>> order_id = oerp.create('pos.order', {'session_id': session_id, 'pricelist_id': 1})
>>> order_line_id = oerp.create('pos.order.line', {'order_id': order_id, 'product_id': 23, 'qty': 1.0})
>>> order_line = oerp.browse('pos.order.line', order_line_id)
>>> order_line.price_unit
0.0
>>> order_line.product_id.list_price
1.0

We see that the unit_price was not updated based on the pricelist_id and product_id.

Any idea how I can retrieve the product price according to the pricelist without implement the pricelist logic myself?

Question information

Language:
English Edit question
Status:
Solved
For:
OERPLib Edit question
Assignee:
No assignee Edit question
Solved by:
codemonk
Solved:
Last query:
Last reply:
Revision history for this message
codemonk (codemonk) said :
#1
Revision history for this message
Sébastien Alix (sebastien-alix) said :
#2

I was on vacation and just saw your question. Glad to know that you have found a solution.
Regards,