From 2327cc45fcc6c788558698d140e583a800ca5c65 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Tue, 29 Jun 2021 12:24:53 +0000 Subject: [PATCH] [FIX] purchase_requisition: Wrong translation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Steps to reproduce the bug: 1. Activate the 2 language “’English’ , ‘Spanish (AR) / Español (AR)’ ” 2. User -> select the language ‘Spanish (AR) / Español (AR)’ 3. Create a new product (Test Product). 4. Create a another product using “Duplicate” function. 5. Rename new product name(Test Product -1) 6. Translate the name ( “Spanish (AR) / Español (AR) : 111 Spanish product “ , “English: English Product” ) 7. create a purchase agreement -> select product “111 Spanish product ” -> Save -> confirm -> new quotation. 8. Purchase Quotation -> Order line Bug: Description shows “Test Item (copia)” opw:2582778 closes odoo/odoo#72997 X-original-commit: 947484cd9a082003bfd5b3c2e64d6033b863aa84 Signed-off-by: Simon Goffin (sig) --- addons/purchase_requisition/models/purchase.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/purchase_requisition/models/purchase.py b/addons/purchase_requisition/models/purchase.py index 6af1f3f0cb3..a3665665fd5 100644 --- a/addons/purchase_requisition/models/purchase.py +++ b/addons/purchase_requisition/models/purchase.py @@ -48,7 +48,7 @@ class PurchaseOrder(models.Model): for line in requisition.line_ids: # Compute name product_lang = line.product_id.with_context( - lang=partner.lang, + lang=partner.lang or self.env.user.lang, partner_id=partner.id ) name = product_lang.display_name