From 602e1c77b31ab8016cb436bd2308987ab0cb2d44 Mon Sep 17 00:00:00 2001 From: "Hamza (hisl)" Date: Tue, 16 May 2023 15:06:02 +0000 Subject: [PATCH] [FIX] purchase : correct line id for invoice origin Steps to reproduce: 1. Create a bill from document, 2. Fill in PO in auto complete, confirm, check the bills list. 3. The source document is not populated in the list. What is the current behavior that you observe? The source document is in the log, but does not show up in the dashboard. What would be your expected behavior in this case? The PO should show up in the source document in the list OPW-3284992 closes odoo/odoo#122280 X-original-commit: e3289decaf95034f0ebba307350d3913a604eb8d Signed-off-by: William Henrotin (whe) --- addons/purchase/models/account_invoice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/purchase/models/account_invoice.py b/addons/purchase/models/account_invoice.py index 8897f16e565..f7d75dc326f 100644 --- a/addons/purchase/models/account_invoice.py +++ b/addons/purchase/models/account_invoice.py @@ -67,7 +67,7 @@ class AccountMove(models.Model): ) # Compute invoice_origin. - origins = set(self.line_ids.mapped('purchase_line_id.order_id.name')) + origins = set(self.invoice_line_ids.mapped('purchase_line_id.order_id.name')) self.invoice_origin = ','.join(list(origins)) # Compute ref.