[FIX] purchase: default user_id on bill
- Create a PO, change the Purchase Representative (`user_id`) - Create the corresponding vendor bill The `user_id` of the PO is not transferred to the invoice. There is no reason to not keep the value. opw-2046963 closes odoo/odoo#35611 Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This commit is contained in:
@@ -404,6 +404,8 @@ 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