19.0 vanilla

This commit is contained in:
Ernad Husremovic 2026-03-09 09:31:28 +01:00
parent ff721d030e
commit 7721452493
1826 changed files with 124775 additions and 274114 deletions

View file

@ -13,18 +13,18 @@ class AccountJournal(models.Model):
_inherit = 'account.journal'
invoice_reference_model = fields.Selection(selection_add=[
('ch', 'Switzerland')
('ch', 'Switzerland (12 34560 00103 88500 1000 19188)')
], ondelete={'ch': lambda recs: recs.write({'invoice_reference_model': 'odoo'})})
def _process_reference_for_sale_order(self, order_reference):
'''
returns the order reference to be used for the payment respecting the ISR
Returns the order reference to be used for the payment, respecting the QRR standard.
'''
self.ensure_one()
if self.invoice_reference_model == 'ch':
# converting the sale order name into a unique number. Letters are converted to their base10 value
invoice_ref = "".join([a if a.isdigit() else str(ord(a)) for a in order_reference])
# id_number = self.company_id.bank_ids.l10n_ch_postal or ''
order_reference = self.env['account.move']._compute_isr_number(invoice_ref)
order_reference = self.env['account.move']._compute_qrr_number(invoice_ref)
return order_reference
return super()._process_reference_for_sale_order(order_reference)