[FIX] point_of_sale: use customer language for invoice product
Current behavior: When creating an invoice from a POS order, the invoice product is not written in the customers language. Steps to reproduce: - Create a customer that uses French as language - Make sure the user is using English as language - Create a POS order for the customer - Invoice the order and look for the product name - The product name is in English but it should be in French opw-3283743 closes odoo/odoo#137027 X-original-commit: 1081f7ff670f30e7d69b5e07fb1eb5b2619e3eaa Signed-off-by: Robin Heinz (rhe) <rhe@odoo.com> Signed-off-by: Robin Engels (roen) <roen@odoo.com>
This commit is contained in:
@@ -225,7 +225,8 @@ class PosOrder(models.Model):
|
||||
order.add_payment(return_payment_vals)
|
||||
|
||||
def _prepare_invoice_line(self, order_line):
|
||||
name = order_line.product_id.get_product_multiline_description_sale()
|
||||
#apply customer language on invoice
|
||||
name = order_line.product_id.with_context(lang=order_line.order_id.partner_id.lang or self.env.user.lang).get_product_multiline_description_sale()
|
||||
return {
|
||||
'product_id': order_line.product_id.id,
|
||||
'quantity': order_line.qty if self.amount_total >= 0 else -order_line.qty,
|
||||
|
||||
Reference in New Issue
Block a user