[FIX] account: invoice computed reference supports sequence suffix
Set a suffix on the sequence that will determines an invoice's move's name Validate an invoice Before this commit, there was a traceback because the regex that matches the invoice number did not match anything due to the suffix After this commit, it works as expected OPW 1903326 closes odoo/odoo#28241
This commit is contained in:
@@ -395,7 +395,9 @@ class AccountInvoice(models.Model):
|
|||||||
def _get_computed_reference(self):
|
def _get_computed_reference(self):
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
if self.company_id.invoice_reference_type == 'invoice_number':
|
if self.company_id.invoice_reference_type == 'invoice_number':
|
||||||
identification_number = int(re.match('.*?([0-9]+)$', self.number).group(1))
|
seq_suffix = self.journal_id.sequence_id.suffix or ''
|
||||||
|
regex_number = '.*?([0-9]+)%s$' % seq_suffix
|
||||||
|
identification_number = int(re.match(regex_number, self.number).group(1))
|
||||||
prefix = self.number
|
prefix = self.number
|
||||||
else:
|
else:
|
||||||
#self.company_id.invoice_reference_type == 'partner'
|
#self.company_id.invoice_reference_type == 'partner'
|
||||||
|
|||||||
Reference in New Issue
Block a user