diff --git a/addons/account/models/account_config_settings.py b/addons/account/models/account_config_settings.py index 9e633d040f2..2f0af8d5429 100644 --- a/addons/account/models/account_config_settings.py +++ b/addons/account/models/account_config_settings.py @@ -50,6 +50,7 @@ class AccountConfigSettings(models.TransientModel): help='This allows you to group received checks before you deposit them to the bank.\n' '-This installs the module account_batch_deposit.') module_account_sepa = fields.Boolean(string='Use SEPA payments') + module_account_sepa_direct_debit = fields.Boolean(string='Use SEPA Direct Debit') module_account_plaid = fields.Boolean(string="Plaid Connector") module_account_yodlee = fields.Boolean("Bank Interface - Sync your bank feeds automatically") module_account_bank_statement_import_qif = fields.Boolean("Import .qif files") diff --git a/addons/account/models/account_payment.py b/addons/account/models/account_payment.py index f464f2069a9..0a70d64c503 100644 --- a/addons/account/models/account_payment.py +++ b/addons/account/models/account_payment.py @@ -465,6 +465,17 @@ class account_payment(models.Model): @api.multi def action_draft(self): return self.write({'state': 'draft'}) + + def action_validate_invoice_payment(self): + """ Posts a payment used to pay an invoice. This function only posts the + payment by default but can be overridden to apply specific post or pre-processing. + It is called by the "validate" button of the popup window + triggered on invoice form by the "Register Payment" button. + """ + if any(len(record.invoice_ids) != 1 for record in self): + # For multiple invoices, there is account.register.payments wizard + raise UserError(_("This method should only be called to process a single invoice's payment.")) + self.post(); def _create_payment_entry(self, amount): """ Create a journal entry corresponding to a payment, if the payment references invoice(s) they are reconciled. diff --git a/addons/account/views/account_config_settings_views.xml b/addons/account/views/account_config_settings_views.xml index 43a8cd0e900..b0321b0983d 100644 --- a/addons/account/views/account_config_settings_views.xml +++ b/addons/account/views/account_config_settings_views.xml @@ -247,6 +247,18 @@ +