[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) <vfe@odoo.com>
This commit is contained in:
Yann Papouin
2021-03-09 20:19:06 +00:00
parent 8f033a2b50
commit 492bd7dafa
@@ -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,
})