[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 392f6f2b2b.
opw-2056061
closes odoo/odoo#36173
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This commit is contained in:
@@ -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) + ")]"
|
||||
|
||||
Reference in New Issue
Block a user