diff options
| author | qdp-odoo <qdp@odoo.com> | 2017-08-29 10:23:57 +0200 |
|---|---|---|
| committer | qdp-odoo <qdp@odoo.com> | 2017-08-29 10:23:57 +0200 |
| commit | db4f62bd115e98c4ff246b4bf4b1fbbbbd046721 (patch) | |
| tree | d5c00bcf903a8d7b480a95482d6033762efa53d8 | |
| parent | 69b421050aa313192bc612ae89bf0dcb3784f903 (diff) | |
[IMP] account: added settings for account_sepa_direct_debit module
| -rw-r--r-- | addons/account/models/account_config_settings.py | 1 | ||||
| -rw-r--r-- | addons/account/models/account_payment.py | 11 | ||||
| -rw-r--r-- | addons/account/views/account_config_settings_views.xml | 16 | ||||
| -rw-r--r-- | addons/account/views/account_payment_view.xml | 2 |
4 files changed, 27 insertions, 3 deletions
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 @@ </div> </div> </div> + <div class="col-xs-12 col-md-6 o_setting_box" title="If you check this box, you will be able to collect payments using SEPA Direct Debit mandates."> + <div class="o_setting_left_pane"> + <field name="module_account_sepa_direct_debit" class="oe_inline" widget="upgrade_boolean"/> + </div> + <div class="o_setting_right_pane" name="sepa_direct_debit_right_pane"> + <label string="SEPA Direct Debit (SDD)" for="module_account_sepa"/> + <span class="fa fa-lg fa-building-o" title="Values set here are company-specific." groups="base.group_multi_company"/> + <div class="text-muted"> + Collect customer payments in one-click using Euro SEPA Service. + </div> + </div> + </div> </div> <t groups="account.group_account_user"> @@ -269,10 +281,10 @@ <field name="module_account_sepa" widget="upgrade_boolean"/> </div> <div class="o_setting_right_pane" name="sepa_right_pane"> - <label string="SEPA Payments" for="module_account_sepa"/> + <label string="SEPA Credit Transfer (SCT)" for="module_account_sepa"/> <span class="fa fa-lg fa-building-o" title="Values set here are company-specific." groups="base.group_multi_company"/> <div class="text-muted"> - Pay your bills in one-click, using Euro SEPA service + Pay your bills in one-click using Euro SEPA service </div> </div> </div> diff --git a/addons/account/views/account_payment_view.xml b/addons/account/views/account_payment_view.xml index 5e463112b3f..27c52b307d4 100644 --- a/addons/account/views/account_payment_view.xml +++ b/addons/account/views/account_payment_view.xml @@ -260,7 +260,7 @@ </group> </sheet> <footer> - <button string='Validate' name="post" type="object" class="btn-primary"/> + <button string='Validate' name="action_validate_invoice_payment" type="object" class="btn-primary"/> <button string="Cancel" class="btn-default" special="cancel"/> </footer> </form> |
