[FIX] contract: Put proper invoice accounting date

Steps to reproduce the problem

- Create a new contract with starting date 2023-01-01.
- Run the advance invoicing wizard on 2022-12-27.

Current behavior:

The invoice has as invoice date (invoice_date) 2023-01-01, but
accounting date (date) 2022-12-27.

Expected behavior:

To have the same accounting date than the invoice date. If not, things
like the new fiscal year numbering won't work correctly.

TT40964
This commit is contained in:
Pedro M. Baeza
2022-12-27 15:43:19 +01:00
parent 5a3ae4d0b5
commit 5548208de0

View File

@@ -445,6 +445,7 @@ class ContractContract(models.Model):
"company_id": self.company_id.id,
"currency_id": self.currency_id.id,
"invoice_date": date_invoice,
"date": date_invoice,
"journal_id": journal.id,
"invoice_origin": self.name,
}