Skip to content

Commit

Permalink
[FIX] l10n_do_accounting: fix seq with same prefix in diferent year
Browse files Browse the repository at this point in the history
  • Loading branch information
jorge-pcg committed May 7, 2024
1 parent c3a74e2 commit 2b62a36
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions l10n_do_accounting/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -1020,3 +1020,16 @@ 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']
and not self._context.get("is_l10n_do_seq", False)):
return 'year'
elif self._context.get("is_l10n_do_seq", False):
return 'never'
else:
'never'
return super(AccountMove, self)._deduce_sequence_number_reset(name)

0 comments on commit 2b62a36

Please sign in to comment.