# HG changeset patch
# User Etienne Ferriere <etienne.ferriere@xcg-consulting.fr>
# Date 1728394852 -7200
#      Tue Oct 08 15:40:52 2024 +0200
# Branch 11.0
# Node ID 6648418880a7aaeaf7a838b32be84f56536d280b
# Parent  3ba3d0ad405063f9b24bdc2ddb12c48302bd86e9
Fix unit test on mass validation of monthly statements for a bug linked to the
execution date.

diff --git a/NEWS.rst b/NEWS.rst
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -2,6 +2,8 @@
 ==========
 
 * Enable mass validation of monthly statements.
+* Fix unit test on mass validation of monthly statements for a bug linked to
+  the execution date.
 
 11.0.1.6.1
 ==========
diff --git a/tests/test_account_report.py b/tests/test_account_report.py
--- a/tests/test_account_report.py
+++ b/tests/test_account_report.py
@@ -240,6 +240,14 @@
             | self.env.ref("base.res_partner_2")
             | self.env.ref("base.res_partner_3")
         ):
+            self.env.cr.execute(
+                """DELETE FROM account_invoice CASCADE
+                WHERE partner_id = %(partner_id)s;
+                DELETE FROM account_move CASCADE
+                WHERE partner_id = %(partner_id)s;
+                """,
+                {"partner_id": partner.id},
+            )
             invoice = self._makeInvoice(partner)
             self._validateInvoices(invoice)
             line_to_pay = invoice.move_id.line_ids.filtered(