From 841d013deeff83886d1769ccaac5431cfe2732d4 Mon Sep 17 00:00:00 2001 From: roen-odoo Date: Thu, 28 Sep 2023 14:30:16 +0200 Subject: [PATCH] [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) Signed-off-by: Robin Engels (roen) --- addons/point_of_sale/models/pos_order.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/point_of_sale/models/pos_order.py b/addons/point_of_sale/models/pos_order.py index 87607f2c7e2..a5e2478f580 100644 --- a/addons/point_of_sale/models/pos_order.py +++ b/addons/point_of_sale/models/pos_order.py @@ -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,