Skip to Content
Menu
This question has been flagged

Hi all,

how i can recuperate the value of Sales price(list_price) of template.product in the order line pos.order.line , i need the sale price value at the time of order creation.
because the unit price displayed in the pos order line is a price based on the price list.
thanks

Avatar
Discard
Best Answer

Hi Fojja,

You can retrieve the sales price (list_price) of a product in the pos.order.line by using the related field on the pos.order.line model to access the product.template model. The related field on the pos.order.line model is "product_id", and the related field on the product.template model is "list_price". To access the sales price, you would use the following code:

pythonCopy codeorder_line = self.env['pos.order.line'].browse(id)
sales_price = order_line.product_id.product_tmpl_id.list_price

Note that the value of id should be replaced with the actual ID of the pos.order.line you want to retrieve the sales price for.

Regards,

Team Ksolves!


Avatar
Discard
Author

Hi Ksolves India Limited (Odoo Gold Partner)
thanks for responding me,
but i want to get the sale price at the time of order creation
and not actual product price in product.template

Hi Fojja, Please check updated answer as per your reply

Related Posts Replies Views Activity
1
Jul 24
1330
0
Jan 23
9
1
Nov 22
1590
2
Jul 22
1168
1
Jun 22
983