From 6d8e5efa84ddabd349068bbbaa7c25de14ce1dbc Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Wed, 28 Aug 2019 09:54:52 +0000 Subject: [PATCH] [FIX] purchase: default user_id on bill On top of leading to AccessError in multi-company (if the PO was created by OdooBot), it might also assign a user without Accounting rights to a vendor bill. This reverts commit 392f6f2b2bbb49a8a55b94510d51fa789b20a127. opw-2056061 closes odoo/odoo#36173 Signed-off-by: Nicolas Martinelli (nim) --- addons/purchase/models/purchase.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/addons/purchase/models/purchase.py b/addons/purchase/models/purchase.py index 021d4d4ca7f..d083ad98af7 100644 --- a/addons/purchase/models/purchase.py +++ b/addons/purchase/models/purchase.py @@ -404,8 +404,6 @@ class PurchaseOrder(models.Model): 'default_company_id': self.company_id.id, 'company_id': self.company_id.id } - if self.user_id: - result['context']['default_user_id'] = self.user_id.id # choose the view_mode accordingly if len(self.invoice_ids) > 1 and not create_bill: result['domain'] = "[('id', 'in', " + str(self.invoice_ids.ids) + ")]"