From 57e714d8d10b6d618d7d798d14005775c632c69a Mon Sep 17 00:00:00 2001 From: wan Date: Thu, 30 Sep 2021 09:45:58 +0000 Subject: [PATCH] [FIX] account: empty string is an empty sequence MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The empty string, the forward slash `/` and NULL are all to be considered as without a sequence set on `account.move`. While this is just true, it was detected because of non deterministic bugs at the end of the month because the tax closing move was explicitly set to an empty string on version 14.3 and higher. See: https://github.com/odoo/enterprise/commit/4641825daa0ed3b8e407fb3817c582cb541e88a4 Most of the tests posting an entry in the MISC journal could then randomly fail on the last day of the month. closes odoo/odoo#77532 X-original-commit: 9ed77eb3eee660a77a90c231258b69968e3b8df2 Signed-off-by: Quentin De Paoli (qdp) Signed-off-by: William André (wan) --- addons/account/models/account_move.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index cd8ded3a128..190deeedc53 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -1278,7 +1278,7 @@ class AccountMove(models.Model): param = {'journal_id': self.journal_id.id} if not relaxed: - domain = [('journal_id', '=', self.journal_id.id), ('id', '!=', self.id or self._origin.id), ('name', 'not in', ('/', False))] + domain = [('journal_id', '=', self.journal_id.id), ('id', '!=', self.id or self._origin.id), ('name', 'not in', ('/', '', False))] if self.journal_id.refund_sequence: refund_types = ('out_refund', 'in_refund') domain += [('move_type', 'in' if self.move_type in refund_types else 'not in', refund_types)]