From 492bd7dafae7b3631b9f4c33895b99dd62055c60 Mon Sep 17 00:00:00 2001 From: Yann Papouin Date: Tue, 9 Mar 2021 12:32:55 +0000 Subject: [PATCH] [FIX] sale_purchase: Invalid context mapping When canceling a purchase order generated from a SO, a warning activity is generated on the SO to warn the salesman that the PO was cancelled. But the activity message was incomplete, because the cancelled PO lines were given as 'purchase_lines' to the rendering context, but expected as 'purchase_order_lines' in the qweb template. This commit ensures that the correct key is used and that the activity message is clear and complete. Fixes #67508 closes odoo/odoo#67572 X-original-commit: ba7336a9d696e8506943edca2f3871f78fac3e99 Signed-off-by: Victor Feyens (vfe) --- addons/sale_purchase/models/purchase_order.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale_purchase/models/purchase_order.py b/addons/sale_purchase/models/purchase_order.py index a190130c5ce..e4bd496b973 100644 --- a/addons/sale_purchase/models/purchase_order.py +++ b/addons/sale_purchase/models/purchase_order.py @@ -63,7 +63,7 @@ class PurchaseOrder(models.Model): views_or_xmlid='sale_purchase.exception_sale_on_purchase_cancellation', render_context={ 'purchase_orders': purchase_order_lines.mapped('order_id'), - 'purchase_lines': purchase_order_lines, + 'purchase_order_lines': purchase_order_lines, })