LSV and Postfinance Direct Debit file generation

l10n_ch_lsv_dd
REPOSITORY
REPOSITORYOCA/l10n-switzerland
GIT
GIThttps://github.com/OCA/l10n-switzerland.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/l10n-switzerland/tree/10.0/l10n_ch_lsv_dd
VERSION
VERSION 1.1.0
CATEGORY
CATEGORYLocalization
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), brain-tec AG, Compassion
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), brain-tec AG, Compassion
COMMITTERS
COMMITTERSYannick Vaucher, GitHub, Emanuel Cino, oca-travis, OCA-git-bot
WEBSITE
WEBSITEhttp://www.compassion.ch,http://www.braintec-group.com
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:20:03
ODOO DEPENDENCIES
ODOO DEPENDENCIES OCA/account-reconcile:
    - base_transaction_id
OCA/bank-payment:
    - account_payment_partner
    - account_payment_mode
    - account_banking_sepa_direct_debit
    - account_banking_pain_base
    - account_payment_order
    - account_banking_mandate
OCA/l10n-switzerland:
    - l10n_ch_payment_slip
    - l10n_ch_base_bank
odoo/odoo:
    - base
    - account
    - base_setup
    - web_kanban
    - web
    - product
    - decimal_precision
    - mail
    - bus
    - web_tour
    - report
    - analytic
    - web_planner
    - base_iban
    - sale
    - sales_team
    - procurement
    - l10n_ch
    - l10n_multilang
    - document
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES lxml
unidecode
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (12)
XML IDNameModelTypeStatus
account_payment_method_form account_payment_method.form account.payment.method field Inherits account_payment_mode.account_payment_method_form
l10n_ch_view_res_partner_bank_from_invoice_slip_lsv_dd_form l10n_ch_view_res_partner_bank_from_invoice_slip_lsv_dd_form res.partner.bank data Inherits l10n_ch_payment_slip.l10n_ch_view_res_partner_bank_from_invoice_slip
swiss_account_payment_line_form swiss.pain.base.account.payment.line account.payment.line field Inherits account_banking_pain_base.account_payment_line_form
swiss_bank_payment_line_form swiss.pain.base.bank.payment.line.form bank.payment.line field Inherits account_banking_pain_base.bank_payment_line_form
swiss_initiating_party_identifier_account_payment_mode_form Makes visible the Initiation Party identifiers on payment mode form account.payment.mode field Inherits account_banking_pain_base.account_payment_mode_form
swiss_sepa_creditor_identifier_account_payment_mode_form Makes visible the SEPA identifiers on payment mode form account.payment.mode field Inherits account_banking_sepa_direct_debit.account_payment_mode_form
view_banking_export_ch_dd_form banking.export.ch.dd.form banking.export.ch.dd form New
view_banking_export_ch_dd_tree banking.export.ch.dd.tree banking.export.ch.dd tree New
view_lsv_export_wizard_form LSV export wizard view lsv.export.wizard form New
view_partner_bank_lsv_dd_form view_partner_bank_lsv_dd_form res.partner.bank data Inherits base.view_partner_bank_form
view_payment_order_invoice_button_form payment.order.invoice.button.form account.payment.order field Inherits account_payment_order.account_payment_order_form
view_post_dd_export_wizard_form Post dd export wizard view post.dd.export.wizard form New
Models touched (7)

New fields (0)

No new fields.

Public methods (1)
  • line2bank(self, payment_mode_id)
    @api.multi
    Override line2bank to avoid choosing a bank that has only cancelled mandate.

New fields (2)
  • lsv_treatment_type Selection
    default='T' help='Mode to use when generating an LSV payment file with this payment method.' required=True string='LSV Treatment Type' args: [('P', _('Production')), ('T', _('Test'))]
  • pain_version Selection
    selection_add=[('pain.008.001.02.ch.03', 'pain.008.001.02.ch.03 (XML Direct Debit)')]
Public methods (1)
  • get_xsd_file_path(self)
    @api.multi

New fields (0)

No new fields.

Public methods (11)
  • generate_dd_transaction_information(self, parent_node, partner_bank, lines, gen_args)
    @api.multi
    Takes portions of the code that is inside account_banking_sepa_direct_debit's generate_payment_file(). Implements the //<DrctDbtTxInf> part of the XML for pain.008.001.03.ch.01.
  • generate_group_header_block(self, parent_node, gen_args)
    @api.model
    Overridden because of pain.008.001.03.ch.01.
  • generate_pain_attrib(self)
    @api.multi
    Overridden to add the new pain.008.001.03.ch.01 pain version to the list.
  • generate_pain_nsmap(self)
    @api.multi
    Overridden to add the new pain.008.001.03.ch.01 pain version to the list.
  • generate_party_acc_number(self, parent_node, party_type, order, partner_bank, gen_args, bank_line=None)
    @api.model
    Overridden for pain.008.001.03.ch.01.
  • generate_party_agent(self, parent_node, party_type, order, partner_bank, gen_args, bank_line=None)
    @api.model
    Overridden for pain.008.001.03.ch.01.
  • generate_party_block(self, parent_node, party_type, order, partner_bank, gen_args, bank_line=None)
    @api.model
    This is overridden because pain.008.001.03.ch.01 uses a different XML structure. The code is basically the same that can be found on the module account_banking_pain_base's method generate_party_block().
  • generate_payment_file(self)
    @api.multi
    Overridden to consider LSV and DD. Returns (payment file as string, filename)
  • generate_start_payment_info_block(self, parent_node, payment_info_ident, priority, local_instrument, category_purpose, sequence_type, requested_date, eval_ctx, gen_args)
    @api.model
    This is overridden because pain.008.001.03.ch.01 uses a different XML structure. The code is basically the same that can be found on the module account_banking_pain_base's method generate_start_payment_info_block().
  • generate_xml_ch_dd_file(self)
    @api.multi
    Generates the XML Direct Debit file for pain.008.001.03.ch.01.
  • show_invoices(self)
    @api.multi

New fields (8)
  • create_date Datetime
    readonly=True args: 'Generation Date'
  • file Binary
    readonly=True args: 'Generated file'
  • filename Char
    readonly=True size=256
  • nb_transactions Integer
    readonly=True args: 'Number of Transactions'
  • payment_order_ids Many2many → account.payment.order
    readonly=True args: 'account.payment.order', 'account_payment_order_ch_dd_rel', 'banking_export_ch_dd_id', 'account_order_id', 'Payment Orders'
  • state Selection
    default='draft' readonly=True args: [('draft', 'Draft'), ('sent', 'Sent')], 'State'
  • total_amount Float
    digits=dp.get_precision('Account') readonly=True args: 'Total Amount'
  • type Char
    readonly=True size=128 args: 'Type'
Public methods (1)
  • create(self, vals)
    @api.model

New fields (8)
  • banking_export_ch_dd_id Many2one → banking.export.ch.dd
    readonly=True args: 'banking.export.ch.dd', 'LSV file'
  • currency Selection
    default='CHF' required=True args: [('CHF', 'CHF'), ('EUR', 'EUR')]
  • file Binary
    related='banking_export_ch_dd_id.file'
  • filename Char
    readonly=True related='banking_export_ch_dd_id.filename' size=256
  • nb_transactions Integer
    related='banking_export_ch_dd_id.nb_transactions' args: 'Number of Transactions'
  • state Selection
    default='create' readonly=True args: [('create', 'Create'), ('finish', 'Finish')]
  • total_amount Float
    related='banking_export_ch_dd_id.total_amount'
  • treatment_type Selection
    default='P' required=True args: [('P', 'Production'), ('T', 'Test')]
Public methods (3)
  • cancel_export(self)
    @api.multi
    Cancel the export: delete export record
  • confirm_export(self)
    @api.multi
    Save the exported LSV file: mark all payments in the file as 'sent'. Write 'last debit date' on mandate.
  • generate_lsv_file(self)
    @api.multi
    Generate direct debit export object including the lsv file content. Called by generate button.

New fields (7)
  • banking_export_ch_dd_id Many2one → banking.export.ch.dd
    readonly=True args: 'banking.export.ch.dd', 'Direct Debit file'
  • currency Selection
    default='CHF' required=True args: [('CHF', 'CHF'), ('EUR', 'EUR')]
  • file Binary
    related='banking_export_ch_dd_id.file'
  • filename Char
    readonly=True related='banking_export_ch_dd_id.filename' size=256
  • nb_transactions Integer
    readonly=True related='banking_export_ch_dd_id.nb_transactions' args: 'Number of Transactions'
  • state Selection
    default='create' readonly=True args: [('create', _('Create')), ('finish', _('Finish'))]
  • total_amount Float
    readonly=True related='banking_export_ch_dd_id.total_amount' args: 'Total Amount'
Public methods (3)
  • cancel_export(self)
    @api.multi
    Cancel the export: delete export record
  • confirm_export(self)
    @api.one
    Save the exported DD file: mark all payments in the file as 'sent'. Write 'last debit date' on mandate.
  • generate_dd_file(self)
    @api.multi
    Generate direct debit export object including the direct debit file content. Called by generate button

New fields (3)
  • esr_party_number Char
    help='ESR party number is an identifier attributed to your bank to generate ESR references. This identifier is composed of up to 9 alphanumeric characters and is required when using ESR references in your LSV direct debit orders' size=9 args: 'ESR party number'
  • lsv_identifier Char
    help='Enter the LSV Identifier that has been attributed to your company to make LSV Direct Debits. This identifier is composed of 5 alphanumeric characters and is required to generate LSV direct debit orders.' size=5 args: 'LSV Identifier'
  • post_dd_identifier Char
    size=6 args: 'Postfinance DD Customer No.'
Public methods (2)
  • is_lsv_identifier_valid(self, lsv_identifier)
    @api.model
    Check if given LSV Identifier is valid
  • is_post_dd_ident_valid(self, dd_identifier)
    @api.model
    Check if given Postfinance DD Identifier is valid
REPOSITORY
REPOSITORYOCA/l10n-switzerland
GIT
GIThttps://github.com/OCA/l10n-switzerland.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/l10n-switzerland/tree/9.0/l10n_ch_lsv_dd
VERSION
VERSION 1.0.0
CATEGORY
CATEGORYLocalization
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), brain-tec AG, Compassion
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), brain-tec AG, Compassion
COMMITTERS
COMMITTERSBogdan Stanciu, GitHub, OCA Transbot, Emanuel Cino, oca-travis, Weblate, OCA-git-bot, BT-cserra
WEBSITE
WEBSITEhttp://www.compassion.ch,http://www.braintec-group.com
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:15:25
ODOO DEPENDENCIES
ODOO DEPENDENCIES OCA/account-reconcile:
    - base_transaction_id
OCA/bank-payment:
    - account_payment_partner
    - account_payment_mode
    - account_payment_order
    - account_banking_mandate
    - account_banking_pain_base
    - account_banking_sepa_direct_debit
OCA/l10n-switzerland:
    - l10n_ch_payment_slip
    - l10n_ch_base_bank
odoo/odoo:
    - base
    - account
    - base_setup
    - web_kanban
    - web
    - product
    - decimal_precision
    - mail
    - bus
    - report
    - analytic
    - web_tip
    - web_planner
    - base_iban
    - sale
    - sales_team
    - procurement
    - document
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES lxml
unidecode
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (13)
XML IDNameModelTypeStatus
account_invoice_free_view account.invoice.free.form account.invoice.free form New
account_payment_method_form account_payment_method.form account.payment.method field Inherits account_payment_mode.account_payment_method_form
l10n_ch_view_res_partner_bank_from_invoice_slip_lsv_dd_form l10n_ch_view_res_partner_bank_from_invoice_slip_lsv_dd_form res.partner.bank data Inherits l10n_ch_payment_slip.l10n_ch_view_res_partner_bank_from_invoice_slip
swiss_account_payment_line_form swiss.pain.base.account.payment.line account.payment.line field Inherits account_banking_pain_base.account_payment_line_form
swiss_bank_payment_line_form swiss.pain.base.bank.payment.line.form bank.payment.line field Inherits account_banking_pain_base.bank_payment_line_form
swiss_initiating_party_identifier_account_payment_mode_form Makes visible the Initiation Party identifiers on payment mode form account.payment.mode field Inherits account_banking_pain_base.account_payment_mode_form
swiss_sepa_creditor_identifier_account_payment_mode_form Makes visible the SEPA identifiers on payment mode form account.payment.mode field Inherits account_banking_sepa_direct_debit.account_payment_mode_form
view_banking_export_ch_dd_form banking.export.ch.dd.form banking.export.ch.dd form New
view_banking_export_ch_dd_tree banking.export.ch.dd.tree banking.export.ch.dd tree New
view_lsv_export_wizard_form LSV export wizard view lsv.export.wizard form New
view_partner_bank_lsv_dd_form view_partner_bank_lsv_dd_form res.partner.bank data Inherits base.view_partner_bank_form
view_payment_order_invoice_button_form payment.order.invoice.button.form account.payment.order field Inherits account_payment_order.account_payment_order_form
view_post_dd_export_wizard_form Post dd export wizard view post.dd.export.wizard form New
Models touched (9)

New fields (0)

No new fields.

Public methods (1)
  • cancel_payment_lines(self)
    @api.multi
    This function simply finds related payment lines and move them in a new payment order.

New fields (0)

No new fields.

Public methods (1)
  • invoice_free(self)
    @api.multi

New fields (0)

No new fields.

Public methods (1)
  • line2bank(self, payment_mode_id)
    @api.multi
    Override line2bank to avoid choosing a bank that has only cancelled mandate.

New fields (2)
  • lsv_treatment_type Selection
    default='T' help='Mode to use when generating an LSV payment file with this payment method.' required=True string='LSV Treatment Type' args: [('P', _('Production')), ('T', _('Test'))]
  • pain_version Selection
    selection_add=[('pain.008.001.02.ch.03', 'pain.008.001.02.ch.03 (XML Direct Debit)')]
Public methods (1)
  • get_xsd_file_path(self)
    @api.multi

New fields (0)

No new fields.

Public methods (11)
  • generate_dd_transaction_information(self, parent_node, partner_bank, lines, gen_args)
    @api.multi
    Takes portions of the code that is inside account_banking_sepa_direct_debit's generate_payment_file(). Implements the //<DrctDbtTxInf> part of the XML for pain.008.001.03.ch.01.
  • generate_group_header_block(self, parent_node, gen_args)
    @api.model
    Overridden because of pain.008.001.03.ch.01.
  • generate_pain_attrib(self)
    @api.multi
    Overridden to add the new pain.008.001.03.ch.01 pain version to the list.
  • generate_pain_nsmap(self)
    @api.multi
    Overridden to add the new pain.008.001.03.ch.01 pain version to the list.
  • generate_party_acc_number(self, parent_node, party_type, order, partner_bank, gen_args, bank_line=None)
    @api.model
    Overridden for pain.008.001.03.ch.01.
  • generate_party_agent(self, parent_node, party_type, order, partner_bank, gen_args, bank_line=None)
    @api.model
    Overridden for pain.008.001.03.ch.01.
  • generate_party_block(self, parent_node, party_type, order, partner_bank, gen_args, bank_line=None)
    @api.model
    This is overridden because pain.008.001.03.ch.01 uses a different XML structure. The code is basically the same that can be found on the module account_banking_pain_base's method generate_party_block().
  • generate_payment_file(self)
    @api.multi
    Overridden to consider LSV and DD. Returns (payment file as string, filename)
  • generate_start_payment_info_block(self, parent_node, payment_info_ident, priority, local_instrument, sequence_type, requested_date, eval_ctx, gen_args)
    @api.model
    This is overridden because pain.008.001.03.ch.01 uses a different XML structure. The code is basically the same that can be found on the module account_banking_pain_base's method generate_start_payment_info_block().
  • generate_xml_ch_dd_file(self)
    @api.multi
    Generates the XML Direct Debit file for pain.008.001.03.ch.01.
  • show_invoices(self)
    @api.multi

New fields (8)
  • create_date Datetime
    readonly=True args: 'Generation Date'
  • file Binary
    readonly=True args: 'Generated file'
  • filename Char
    readonly=True size=256
  • nb_transactions Integer
    readonly=True args: 'Number of Transactions'
  • payment_order_ids Many2many → account.payment.order
    readonly=True args: 'account.payment.order', 'account_payment_order_ch_dd_rel', 'banking_export_ch_dd_id', 'account_order_id', 'Payment Orders'
  • state Selection
    default='draft' readonly=True args: [('draft', 'Draft'), ('sent', 'Sent')], 'State'
  • total_amount Float
    digits_compute=dp.get_precision('Account') readonly=True args: 'Total Amount'
  • type Char
    readonly=True size=128 args: 'Type'
Public methods (1)
  • create(self, vals)
    @api.model

New fields (8)
  • banking_export_ch_dd_id Many2one → banking.export.ch.dd
    readonly=True args: 'banking.export.ch.dd', 'LSV file'
  • currency Selection
    default='CHF' required=True args: [('CHF', 'CHF'), ('EUR', 'EUR')]
  • file Binary
    related='banking_export_ch_dd_id.file'
  • filename Char
    readonly=True related='banking_export_ch_dd_id.filename' size=256
  • nb_transactions Integer
    related='banking_export_ch_dd_id.nb_transactions' args: 'Number of Transactions'
  • state Selection
    default='create' readonly=True args: [('create', _('Create')), ('finish', _('Finish'))]
  • total_amount Float
    related='banking_export_ch_dd_id.total_amount'
  • treatment_type Selection
    default='T' required=True args: [('P', _('Production')), ('T', _('Test'))]
Public methods (3)
  • cancel_export(self)
    @api.multi
    Cancel the export: delete export record
  • confirm_export(self)
    @api.multi
    Save the exported LSV file: mark all payments in the file as 'sent'. Write 'last debit date' on mandate.
  • generate_lsv_file(self)
    @api.multi
    Generate direct debit export object including the lsv file content. Called by generate button.

New fields (7)
  • banking_export_ch_dd_id Many2one → banking.export.ch.dd
    readonly=True args: 'banking.export.ch.dd', 'Direct Debit file'
  • currency Selection
    default='CHF' required=True args: [('CHF', 'CHF'), ('EUR', 'EUR')]
  • file Binary
    related='banking_export_ch_dd_id.file'
  • filename Char
    readonly=True related='banking_export_ch_dd_id.filename' size=256
  • nb_transactions Integer
    readonly=True related='banking_export_ch_dd_id.nb_transactions' args: 'Number of Transactions'
  • state Selection
    default='create' readonly=True args: [('create', _('Create')), ('finish', _('Finish'))]
  • total_amount Float
    readonly=True related='banking_export_ch_dd_id.total_amount' args: 'Total Amount'
Public methods (3)
  • cancel_export(self)
    @api.multi
    Cancel the export: delete export record
  • confirm_export(self)
    @api.one
    Save the exported DD file: mark all payments in the file as 'sent'. Write 'last debit date' on mandate.
  • generate_dd_file(self)
    @api.multi
    Generate direct debit export object including the direct debit file content. Called by generate button

New fields (3)
  • esr_party_number Char
    help='ESR party number is an identifier attributed to your bank to generate ESR references. This identifier is composed of up to 9 alphanumeric characters and is required when using ESR references in your LSV direct debit orders' size=9 args: 'ESR party number'
  • lsv_identifier Char
    help='Enter the LSV Identifier that has been attributed to your company to make LSV Direct Debits. This identifier is composed of 5 alphanumeric characters and is required to generate LSV direct debit orders.' size=5 args: 'LSV Identifier'
  • post_dd_identifier Char
    size=6 args: 'Postfinance DD Customer No.'
Public methods (2)
  • is_lsv_identifier_valid(self, lsv_identifier)
    @api.model
    Check if given LSV Identifier is valid
  • is_post_dd_ident_valid(self, dd_identifier)
    @api.model
    Check if given Postfinance DD Identifier is valid
REPOSITORY
REPOSITORYOCA/l10n-switzerland
GIT
GIThttps://github.com/OCA/l10n-switzerland.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/l10n-switzerland/tree/8.0/l10n_ch_lsv_dd
VERSION
VERSION 1.0.0
CATEGORY
CATEGORYLocalization
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), Compassion
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), Compassion
COMMITTERS
COMMITTERSYannick Vaucher, GitHub, Stéphane Bidoul (ACSONE), OCA Transbot, Emanuel Cino, OCA-git-bot
WEBSITE
WEBSITEhttp://www.compassion.ch
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:11:28
ODOO DEPENDENCIES
ODOO DEPENDENCIES OCA/account-reconcile:
    - base_transaction_id
OCA/bank-payment:
    - account_direct_debit
    - account_banking_payment_export
    - account_banking_mandate
OCA/l10n-switzerland:
    - l10n_ch_payment_slip_base_transaction_id
    - l10n_ch_payment_slip
    - l10n_ch_base_bank
odoo/odoo:
    - account_payment
    - account
    - base_setup
    - base
    - web_kanban
    - web
    - product
    - decimal_precision
    - mail
    - report
    - analytic
    - board
    - edi
    - email_template
    - account_voucher
    - base_iban
    - document
    - knowledge
    - stock_account
    - stock
    - procurement
    - web_kanban_gauge
    - web_kanban_sparkline
    - sale_stock
    - sale
    - sales_team
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (7)
XML IDNameModelTypeStatus
account_invoice_free_view account.invoice.free.form account.invoice.free form New
l10nch_view_res_partner_bank_lsv_form res.partner_bank.form.l10n_ch.lsv res.partner.bank data Inherits l10n_ch_payment_slip.l10nch_view_res_partner_bank_from_invoice_slip
view_banking_export_ch_dd_form banking.export.ch.dd.form banking.export.ch.dd form New
view_banking_export_ch_dd_tree banking.export.ch.dd.tree banking.export.ch.dd tree New
view_lsv_export_wizard_form LSV export wizard view lsv.export.wizard form New
view_payment_order_invoice_button_form payment.order.invoice.button.form payment.order field Inherits account_payment.view_payment_order_form
view_post_dd_export_wizard_form Post dd export wizard view post.dd.export.wizard form New
Models touched (8)

New fields (0)

No new fields.

Public methods (1)
  • cancel_payment_lines(self)
    @api.multi
    This function simply finds related payment lines and move them in a new payment order.

New fields (0)

No new fields.

Public methods (1)
  • invoice_free(self)
    @api.multi

New fields (0)

No new fields.

Public methods (1)
  • line2bank(self, payment_mode_id)
    @api.multi
    Override line2bank to avoid choosing a bank that has only cancelled mandate.

New fields (8)
  • create_date Datetime
    readonly=True args: 'Generation Date'
  • file Binary
    readonly=True args: 'Generated file'
  • filename Char
    readonly=True size=256
  • nb_transactions Integer
    readonly=True args: 'Number of Transactions'
  • payment_order_ids Many2many → payment.order
    readonly=True args: 'payment.order', 'account_payment_order_ch_dd_rel', 'banking_export_ch_dd_id', 'account_order_id', 'Payment Orders'
  • state Selection
    default='draft' readonly=True args: [('draft', 'Draft'), ('sent', 'Sent')], 'State'
  • total_amount Float
    digits_compute=dp.get_precision('Account') readonly=True args: 'Total Amount'
  • type Char
    readonly=True size=128 args: 'Type'
Public methods (1)
  • create(self, vals)
    @api.model

New fields (8)
  • banking_export_ch_dd_id Many2one → banking.export.ch.dd
    readonly=True args: 'banking.export.ch.dd', 'LSV file'
  • currency Selection
    default='CHF' required=True args: [('CHF', 'CHF'), ('EUR', 'EUR')]
  • file Binary
    related='banking_export_ch_dd_id.file'
  • filename Char
    readonly=True related='banking_export_ch_dd_id.filename' size=256
  • nb_transactions Integer
    related='banking_export_ch_dd_id.nb_transactions' args: 'Number of Transactions'
  • state Selection
    default='create' readonly=True args: [('create', _('Create')), ('finish', _('Finish'))]
  • total_amount Float
    related='banking_export_ch_dd_id.total_amount'
  • treatment_type Selection
    default='T' required=True args: [('P', _('Production')), ('T', _('Test'))]
Public methods (3)
  • cancel_export(self)
    @api.multi
    Cancel the export: delete export record
  • confirm_export(self)
    @api.multi
    Save the exported LSV file: mark all payments in the file as 'sent'. Write 'last debit date' on mandate.
  • generate_lsv_file(self)
    @api.multi
    Generate direct debit export object including the lsv file content. Called by generate button.

New fields (0)

No new fields.

Public methods (1)
  • show_invoices(self)
    @api.multi

New fields (7)
  • banking_export_ch_dd_id Many2one → banking.export.ch.dd
    readonly=True args: 'banking.export.ch.dd', 'Direct Debit file'
  • currency Selection
    default='CHF' required=True args: [('CHF', 'CHF'), ('EUR', 'EUR')]
  • file Binary
    related='banking_export_ch_dd_id.file'
  • filename Char
    readonly=True related='banking_export_ch_dd_id.filename' size=256
  • nb_transactions Integer
    readonly=True related='banking_export_ch_dd_id.nb_transactions' args: 'Number of Transactions'
  • state Selection
    default='create' readonly=True args: [('create', _('Create')), ('finish', _('Finish'))]
  • total_amount Float
    readonly=True related='banking_export_ch_dd_id.total_amount' args: 'Total Amount'
Public methods (3)
  • cancel_export(self)
    @api.multi
    Cancel the export: delete export record
  • confirm_export(self)
    @api.one
    Save the exported DD file: mark all payments in the file as 'sent'. Write 'last debit date' on mandate.
  • generate_dd_file(self)
    @api.multi
    Generate direct debit export object including the direct debit file content. Called by generate button

New fields (3)
  • esr_party_number Char
    help='ESR party number is an identifier attributed to your bank to generate ESR references. This identifier is composed of up to 9 alphanumeric characters and is required when using ESR references in your LSV direct debit orders' size=9 args: 'ESR party number'
  • lsv_identifier Char
    help='Enter the LSV Identifier that has been attributed to your company to make LSV Direct Debits. This identifier is composed of 5 alphanumeric characters and is required to generate LSV direct debit orders.' size=5 args: 'LSV Identifier'
  • post_dd_identifier Char
    size=6 args: 'Postfinance DD Customer No.'
Public methods (2)
  • is_lsv_identifier_valid(self, lsv_identifier)
    @api.model
    Check if given LSV Identifier is valid
  • is_post_dd_ident_valid(self, dd_identifier)
    @api.model
    Check if given Postfinance DD Identifier is valid
REPOSITORY
REPOSITORYOCA/l10n-switzerland
GIT
GIThttps://github.com/OCA/l10n-switzerland.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/l10n-switzerland/tree/7.0/l10n_ch_lsv_dd
VERSION
VERSION 1.0
CATEGORY
CATEGORYLocalization
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), Compassion
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), Compassion
COMMITTERS
COMMITTERSYannick Vaucher, Alexandre Fayolle, Matthieu Dietrich, Nicolas Bessi, OCA Transbot, moylop260, Emanuel Cino, ecino, David Coninckx
WEBSITE
WEBSITEhttp://www.compassion.ch
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:07:17
ODOO DEPENDENCIES
ODOO DEPENDENCIES OCA/account-reconcile:
    - base_transaction_id
OCA/bank-payment:
    - account_direct_debit
    - account_banking_payment_export
    - account_banking_mandate
OCA/l10n-switzerland:
    - l10n_ch_payment_slip_base_transaction_id
    - l10n_ch_payment_slip
    - l10n_ch_base_bank
odoo/odoo:
    - account_payment
    - account
    - base_setup
    - base
    - web_kanban
    - web
    - product
    - process
    - decimal_precision
    - mail
    - analytic
    - board
    - edi
    - email_template
    - account_voucher
    - base_iban
    - report_webkit
    - sale
    - stock
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION
LSV and Postfinance Direct Debit file generator
===============================================
Features:
---------
    * LSV file generation
    * Postfinance Direct Debit file generation
    * Invoice freeing. You can "free" an invoice that is in a direct debit     order. This is because you have sometimes to generate 2 direct debit     order for the same invoice (i.e. if debit fails the first time).


Prerequisite for LSV file generation:
-------------------------------------
For LSV file generation, don't forget :
    * To set your LSV identifier in your beneficiary bank account.
    * To set your BVR identifier in your beneficiary bank account if you want     to use BVR references.
    * To setup a payment mode with payment type "LSV Direct Debit"
    * That each partner which is concerned by LSV has to have a valid bank     account with a valid mandate.

Prerequisite for Postfiance Direct Debit file generation:
---------------------------------------------------------
For postfinance DD file generation, don't forget :
    * To set your Postfinance DD identifier in your beneficiary BVR account.
    * To setup a payment mode with payment type "Postfinance Direct Debit"
    * That each partner which is concerned by Postfinance DD has to have a     valid BV account with a valid mandate.

Standard workflow:
------------------
    * Create some invoices for partners with well configured bank accounts.
    * Create a Direct Debit order with a payment mode having LSV/DD payment     type.
    * Make sure that due dates are in the valid range if you chose "Due date"     as preferred execution date.
    * Press "Confirm payments"
    * Press "Make payments". This will launch the LSV/DD file generation     wizard.
    * Download the generated file and press "Validate". If you need to     download the file again, you can access the generated file with the     "Generated Direct Debit Files" menu.

Currently, only BVR reference usage is implemented (using l10n_ch_payment_slip
 module) for LSV refernece. IPI usage is not implemented yet, this way an
 error occurs if no BVR ref are set in invoices.

This module uses the framework provided by the banking addons, cf
https://github.com/OCA/banking
    

Code Analysis

Views touched (7)
XML IDNameModelTypeStatus
account_invoice_free_view account.invoice.free.form account.invoice.free form New
l10nch_view_res_partner_bank_lsv_form res.partner_bank.form.l10n_ch.lsv res.partner.bank data Inherits l10n_ch_payment_slip.l10nch_view_res_partner_bank_from_invoice_slip
view_banking_export_ch_dd_form banking.export.ch.dd.form banking.export.ch.dd form New
view_banking_export_ch_dd_tree banking.export.ch.dd.tree banking.export.ch.dd tree New
view_lsv_export_wizard_form LSV export wizard view lsv.export.wizard form New
view_payment_order_invoice_button_form payment.order.invoice.button.form payment.order field Inherits account_payment.view_payment_order_form
view_post_dd_export_wizard_form Post dd export wizard view post.dd.export.wizard form New
Models touched (8)

New fields (0)

No new fields.

Public methods (1)
  • cancel_payment_lines(self, cr, uid, ids, context=None)
    This function simply find related payment lines and move them in a new payment order.

New fields (0)

No new fields.

Public methods (1)
  • invoice_free(self, cr, uid, ids, context=None)

New fields (0)

No new fields.

Public methods (1)
  • line2bank(self, cr, uid, ids, payment_mode_id, context=None)
    Override line2bank to avoid choosing a bank that has only cancelled mandate.

New fields (0)

No new fields.

Public methods (0)

No public methods.

New fields (0)

No new fields.

Public methods (3)
  • cancel_export(self, cr, uid, ids, context=None)
    Cancel the export: delete export record
  • confirm_export(self, cr, uid, ids, context=None)
    Save the exported LSV file: mark all payments in the file as 'sent'. Write 'last debit date' on mandate.
  • generate_lsv_file(self, cr, uid, ids, context=None)
    Generate direct debit export object including the lsv file content. Called by generate button.

New fields (0)

No new fields.

Public methods (1)
  • show_invoices(self, cr, uid, ids, context=None)

New fields (0)

No new fields.

Public methods (3)
  • cancel_export(self, cr, uid, ids, context=None)
    Cancel the export: delete export record
  • confirm_export(self, cr, uid, ids, context=None)
    Save the exported DD file: mark all payments in the file as 'sent'. Write 'last debit date' on mandate.
  • generate_dd_file(self, cr, uid, ids, context=None)
    Generate direct debit export object including the direct debit file content. Called by generate button

New fields (0)

No new fields.

Public methods (2)
  • is_lsv_identifier_valid(self, cr, uid, lsv_identifier, context=None)
    Check if given LSV Identifier is valid
  • is_post_dd_ident_valid(self, cr, uid, dd_identifier, context=None)
    Check if given Postfinance DD Identifier is valid