Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
2057 Vistas

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
Descartar
Mejor respuesta

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
Descartar
Autor

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

Publicaciones relacionadas Respuestas Vistas Actividad
1
jul 24
2997
0
ene 23
9
1
nov 22
3069
2
jul 22
2668
1
jun 22
2213