Skip to content

Commit 024dd18

Browse files
[FIX] account_billing: Fix tests
After odoo/odoo@fcaa549, we need to set the invoice date manually.
1 parent 1027e9a commit 024dd18

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

account_billing/tests/test_account_billing.py

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
from dateutil.relativedelta import relativedelta
77

8+
from odoo import fields
89
from odoo.exceptions import ValidationError
910
from odoo.tests.common import SavepointCase
1011

@@ -94,6 +95,7 @@ def create_invoice(
9495
"partner_id": partner or self.partner_agrolait.id,
9596
"currency_id": currency_id or self.currency_eur_id,
9697
"move_type": invoice_type,
98+
"invoice_date": fields.Date.today(),
9799
"invoice_payment_term_id": self.payment_term.id,
98100
"invoice_line_ids": [
99101
[
@@ -217,6 +219,8 @@ def test_6_check_billing_from_bills(self):
217219
if inv_1.state != "posted":
218220
inv_1.action_post()
219221
inv_2 = inv_1.copy()
222+
# Need to explicitly assign invoice date, not kept on copy
223+
inv_2.invoice_date = fields.Date.today()
220224
if inv_2.state != "posted":
221225
inv_2.action_post()
222226
ctx = {

0 commit comments

Comments
 (0)