Skip to content
Snippets Groups Projects
Commit 9af5516e authored by Laurent Smet's avatar Laurent Smet
Browse files

[FIX] account: Fix non-determinist matching-rules tests


If the current date changes when creating the invoices (e.g. nightly builds)
the results are not always in the same order because the matching rules propositions are
sorted by date in the descendant order.

closes odoo/odoo#37653

Signed-off-by: default avatarNicolas Martinelli (nim) <nim@odoo.com>
parent 1f0d2859
No related branches found
No related tags found
No related merge requests found
# -*- coding: utf-8 -*-
from odoo import fields
from odoo.addons.account.tests.account_test_classes import AccountingTestCase
from odoo.tests.common import Form
from odoo.tests import tagged
......@@ -9,6 +10,7 @@ class TestReconciliationMatchingRules(AccountingTestCase):
def _create_invoice_line(self, amount, partner, type):
''' Create an invoice on the fly.'''
invoice_form = Form(self.env['account.move'].with_context(default_type=type))
invoice_form.invoice_date = fields.Date.from_string('2019-09-01')
invoice_form.partner_id = partner
with invoice_form.invoice_line_ids.new() as invoice_line_form:
invoice_line_form.name = 'xxxx'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment