Skip to content
Snippets Groups Projects

Enable mass validation of monthly statements.

Merged Etienne Ferriere requested to merge topic/11.0/TG-5326 into branch/11.0
@@ -234,4 +234,5 @@
def test_monthly_statement_mass_validation(self):
"""Test monthly statements: Mass validation."""
lines_to_pay = []
for partner in (
@@ -237,7 +238,7 @@
for partner in (
self.env.ref("base.res_partner_7")
| self.env.ref("base.res_partner_8")
| self.env.ref("base.res_partner_9")
self.env.ref("base.res_partner_1")
| self.env.ref("base.res_partner_2")
| self.env.ref("base.res_partner_3")
):
invoice = self._makeInvoice(partner)
self._validateInvoices(invoice)
@@ -245,6 +246,7 @@
lambda line: line.account_id.internal_type == "receivable"
)
self.assertEqual(len(line_to_pay), 1)
lines_to_pay.append(line_to_pay)
# Configure the partner for monthly statements.
partner.has_monthly_statements = True
@@ -257,5 +259,5 @@
self.assertEqual(len(batch_ids), 3)
batches = self.env["account.monthly_statement"].browse(batch_ids)
for batch in batches:
for i, batch in enumerate(batches):
self.assertEqual(batch.account_move_line_count, 1)
@@ -261,5 +263,5 @@
self.assertEqual(batch.account_move_line_count, 1)
self.assertEqual(batch.account_move_line_ids, line_to_pay)
self.assertEqual(batch.account_move_line_ids, lines_to_pay[i])
self.assertAlmostEqual(batch.amount, AMOUNT)
self.assertEqual(batch.state, "draft")
@@ -279,6 +281,9 @@
batches.refresh()
self.assertTrue(all(batches.mapped(lambda r: r.state == "done")))
with self.assertRaises(odoo.exceptions.UserError):
server_action.with_context(active_ids=batch_ids).run()
def _launchMonthlyStatement(self):
"""Create montly statements.
"""
Loading