From 18f890187af37802a8f17928b172be7958ecb265 Mon Sep 17 00:00:00 2001 From: Rodrigo Date: Fri, 20 Jan 2023 12:11:00 +0100 Subject: [PATCH] [FIX] account_move_name_sequence: With the "account_move_name_sequence" module the "_get_last_sequence" method does not have to propagate the with_prefix parameter. The sequence_prefix parameter will not be completed and will give error as it is False in this line of code. https://github.com/OCA/OCB/blob/16.0/addons/account/models/sequence_mixin.py#L169 --- account_move_name_sequence/models/account_move.py | 3 +++ account_move_name_sequence/tests/test_account_move_name_seq.py | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/account_move_name_sequence/models/account_move.py b/account_move_name_sequence/models/account_move.py index 8b43a629..f7338dcf 100644 --- a/account_move_name_sequence/models/account_move.py +++ b/account_move_name_sequence/models/account_move.py @@ -70,3 +70,6 @@ class AccountMove(models.Model): if moves: self.flush_model(["name", "journal_id", "move_type", "state"]) return super()._fetch_duplicate_supplier_reference(only_posted=only_posted) + + def _get_last_sequence(self, relaxed=False, with_prefix=None, lock=True): + return super()._get_last_sequence(relaxed, None, lock) diff --git a/account_move_name_sequence/tests/test_account_move_name_seq.py b/account_move_name_sequence/tests/test_account_move_name_seq.py index 4457da0c..c548e028 100644 --- a/account_move_name_sequence/tests/test_account_move_name_seq.py +++ b/account_move_name_sequence/tests/test_account_move_name_seq.py @@ -309,7 +309,6 @@ class TestAccountMoveNameSequence(TransactionCase): ], } ) - in_refund_invoice._compute_split_sequence() self.assertEqual(in_refund_invoice.name, "/") in_refund_invoice.action_post() error_msg = "You cannot delete an item linked to a posted entry."