From 8de07a8aa569cf6e21388d67c02344c8fdf0751e Mon Sep 17 00:00:00 2001 From: "Andrea Grazioso (agr-odoo)" Date: Mon, 17 Feb 2020 08:03:16 +0000 Subject: [PATCH] [FIX] purchase: add source document to vendor bill Create a purchase order, confirm it and create the vendor bill. The source document will be not filled. Fixing the related variable and changing also the missing reference to the partner opw-2197272 closes odoo/odoo#45534 X-original-commit: 8498dbe10db87f718b9287f69188c627e36f98a3 Signed-off-by: Nicolas Martinelli (nim) --- addons/purchase/models/purchase.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/purchase/models/purchase.py b/addons/purchase/models/purchase.py index 41c6b5ac35b..1dc8a09c23a 100644 --- a/addons/purchase/models/purchase.py +++ b/addons/purchase/models/purchase.py @@ -426,8 +426,8 @@ class PurchaseOrder(models.Model): # Do not set an invoice_id if we want to create a new bill. if not create_bill: result['res_id'] = self.invoice_ids.id or False - result['context']['default_origin'] = self.name - result['context']['default_reference'] = self.partner_ref + result['context']['default_invoice_origin'] = self.name + result['context']['default_ref'] = self.partner_ref return result