diff --git a/addons/l10n_ch/models/account_invoice.py b/addons/l10n_ch/models/account_invoice.py index b8982977552..ec2a94abef9 100644 --- a/addons/l10n_ch/models/account_invoice.py +++ b/addons/l10n_ch/models/account_invoice.py @@ -185,3 +185,17 @@ class AccountInvoice(models.Model): if self.env.context.get('l10n_ch_mark_isr_as_sent'): self.filtered(lambda inv: not inv.l10n_ch_isr_sent).write({'l10n_ch_isr_sent': True}) return super(AccountInvoice, self.with_context(mail_post_autofollow=True)).message_post(**kwargs) + + def _get_reference_ch_invoice(self): + """ This sets ISR reference number which is generated based on customer's `Bank Account` and set it as + `Payment Reference` of the invoice when invoice's journal is using Switzerland's communication standard + """ + self.ensure_one() + return self.l10n_ch_isr_number_spaced + + def _get_reference_ch_partner(self): + """ This sets ISR reference number which is generated based on customer's `Bank Account` and set it as + `Payment Reference` of the invoice when invoice's journal is using Switzerland's communication standard + """ + self.ensure_one() + return self.l10n_ch_isr_number_spaced diff --git a/addons/l10n_ch/models/account_journal.py b/addons/l10n_ch/models/account_journal.py index a42e163a299..85646dfa396 100644 --- a/addons/l10n_ch/models/account_journal.py +++ b/addons/l10n_ch/models/account_journal.py @@ -14,6 +14,7 @@ class AccountJournal(models.Model): # creation of bank journals by giving the account number, allow craetion of the l10n_ch_postal = fields.Char(related='bank_account_id.l10n_ch_postal', readonly=False) + invoice_reference_model = fields.Selection(selection_add=[('ch', 'Switzerland')]) @api.model def create(self, vals):