From 9df5f41c70b2166aadc0ad69609340967d6eff6f Mon Sep 17 00:00:00 2001 From: Jorge Conce Date: Tue, 7 May 2024 11:46:59 -0400 Subject: [PATCH] [FIX] l10n_do_accounting: fix seq with same prefix in diferent year --- l10n_do_accounting/models/account_move.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/l10n_do_accounting/models/account_move.py b/l10n_do_accounting/models/account_move.py index 45d35b44f..9e38bb6de 100644 --- a/l10n_do_accounting/models/account_move.py +++ b/l10n_do_accounting/models/account_move.py @@ -1020,3 +1020,12 @@ def unlink(self): _("You cannot delete fiscal invoice which have been posted before") ) return super(AccountMove, self).unlink() + + + @api.model + def _deduce_sequence_number_reset(self, name): + if (self.l10n_latam_use_documents + and self.company_id.country_id.code == "DO" + and name not in ['/', False, '', '1']): + return 'year' + return super(AccountMove, self)._deduce_sequence_number_reset(name)