[FIX] l10n_latam_invoice_document: the gaps message does not make sense for LATAM journals
As the vendor bill names are those from the vendors and the customer invoices are per document type, it does not make a lot of sense to care about the gaps in the traditional sense for LATAM journals. closes odoo/odoo#145173 Signed-off-by: William André (wan) <wan@odoo.com>
This commit is contained in:
@@ -23,6 +23,12 @@ class AccountJournal(models.Model):
|
||||
self.l10n_latam_use_documents = self.type in ['sale', 'purchase'] and \
|
||||
self.l10n_latam_company_use_documents
|
||||
|
||||
def _compute_has_sequence_holes(self):
|
||||
use_documents_journals = self.filtered(lambda j: j.l10n_latam_use_documents)
|
||||
use_documents_journals.has_sequence_holes = False
|
||||
if other_journals := self - use_documents_journals:
|
||||
super(AccountJournal, other_journals)._compute_has_sequence_holes()
|
||||
|
||||
@api.constrains('l10n_latam_use_documents')
|
||||
def check_use_document(self):
|
||||
for rec in self:
|
||||
|
||||
@@ -215,3 +215,9 @@ class AccountMove(models.Model):
|
||||
for rec in self.filtered(lambda x: x.state == 'draft'):
|
||||
document_types = rec.l10n_latam_available_document_type_ids._origin
|
||||
rec.l10n_latam_document_type_id = document_types and document_types[0].id
|
||||
|
||||
def _compute_made_sequence_hole(self):
|
||||
use_documents_moves = self.filtered(lambda m: m.journal_id.l10n_latam_use_documents)
|
||||
use_documents_moves.made_sequence_hole = False
|
||||
if other_moves := self - use_documents_moves:
|
||||
super(AccountMove, other_moves)._compute_made_sequence_hole()
|
||||
|
||||
Reference in New Issue
Block a user