mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[FIX] contract: Fix invoice creation and salesperson assignment
In v13, the `user_id` field is a related field to `invoice_user_id`, that defaults to the environment user (`self.env.user`). Therefore, if we try to create an invoice just by passing `user_id`, it would be overwritten by the default computation of `invoice_user_id`. This fixes it by passing the correct field and data. TT31715
This commit is contained in:
@@ -411,7 +411,7 @@ class ContractContract(models.Model):
|
||||
"invoice_date": date_invoice,
|
||||
"journal_id": journal.id,
|
||||
"invoice_origin": self.name,
|
||||
"user_id": self.user_id.id,
|
||||
"invoice_user_id": self.user_id.id,
|
||||
}
|
||||
)
|
||||
return invoice_vals, move_form
|
||||
|
||||
Reference in New Issue
Block a user