From e01d559f9d558ac0a2600cc18efbd011efd26114 Mon Sep 17 00:00:00 2001 From: Johan Demaret Rivarola Date: Thu, 11 Jul 2019 15:31:19 +0000 Subject: [PATCH] [IMP] payment: support SEPA Direct Debit acquirer The purpose of this commit is to expose SEPA Direct Debit acquirer to the Odoo community edition. The dedicated module, though, is restricted to the enterprise edition. Minor changes in following modules: - base: added ir.module.module record - payment: - added data to expose the new payment acquirer. - added 'to_buy' field to track whether the payment acquirer is restricted to enterprise users. - allow multi word payment acquirer name. It was breaking on the first underscore. task-1870363 closes odoo/odoo#26427 --- addons/payment/data/payment_acquirer_data.xml | 13 +++++++++++++ addons/payment/models/payment_acquirer.py | 3 ++- .../payment/static/src/js/payment_processing.js | 2 +- addons/payment/views/payment_views.xml | 12 ++++++++++-- odoo/addons/base/data/ir_module_module.xml | 10 ++++++++++ .../img/icons/payment_sepa_direct_debit.png | Bin 0 -> 2675 bytes 6 files changed, 36 insertions(+), 4 deletions(-) create mode 100644 odoo/addons/base/static/img/icons/payment_sepa_direct_debit.png diff --git a/addons/payment/data/payment_acquirer_data.xml b/addons/payment/data/payment_acquirer_data.xml index 233baf64501..f956de72633 100644 --- a/addons/payment/data/payment_acquirer_data.xml +++ b/addons/payment/data/payment_acquirer_data.xml @@ -279,4 +279,17 @@ + + + SEPA Direct Debit + + + + +

+ SEPA Direct Debit is a Europe-wide Direct Debit system that allows merchants to collect Euro-denominated payments from accounts in the 34 SEPA countries and associated territories. +

+
+
+ diff --git a/addons/payment/models/payment_acquirer.py b/addons/payment/models/payment_acquirer.py index 31df0df1cd8..f9d703972d8 100644 --- a/addons/payment/models/payment_acquirer.py +++ b/addons/payment/models/payment_acquirer.py @@ -154,6 +154,7 @@ class PaymentAcquirer(models.Model): # TDE FIXME: remove that brol module_id = fields.Many2one('ir.module.module', string='Corresponding Module') module_state = fields.Selection(selection=ir_module.STATES, string='Installation State', related='module_id.state', store=True) + module_to_buy = fields.Boolean(string='Odoo Enterprise Module', related='module_id.to_buy', readonly=True, store=False) image_128 = fields.Image("Image", max_width=128, max_height=128) @@ -271,7 +272,7 @@ class PaymentAcquirer(models.Model): # If the trigger comes from the chart template wizard, the modules are already installed. acquirer_modules = self.env['ir.module.module'].search( [('name', 'like', 'payment_%'), ('state', 'in', ('to install', 'installed'))]) - acquirer_names = [a.name.split('_')[1] for a in acquirer_modules] + acquirer_names = [a.name.split('_', 1)[1] for a in acquirer_modules] # Search for acquirers having no journal company = company or self.env.company diff --git a/addons/payment/static/src/js/payment_processing.js b/addons/payment/static/src/js/payment_processing.js index 361cc3dbf4c..53b688be06a 100644 --- a/addons/payment/static/src/js/payment_processing.js +++ b/addons/payment/static/src/js/payment_processing.js @@ -71,7 +71,7 @@ odoo.define('payment.processing', function (require) { 'tx_error': [], }; - if (transactions.length > 0 && transactions[0].acquirer_provider == 'transfer') { + if (transactions.length > 0 && ['transfer', 'sepa_direct_debit'].indexOf(transactions[0].acquirer_provider) >= 0) { window.location = transactions[0].return_url; return; } diff --git a/addons/payment/views/payment_views.xml b/addons/payment/views/payment_views.xml index f4c4cfc7c05..54264fd2d43 100644 --- a/addons/payment/views/payment_views.xml +++ b/addons/payment/views/payment_views.xml @@ -20,12 +20,14 @@ +

-
@@ -104,10 +106,12 @@ + +
Acquirer @@ -120,7 +124,11 @@ - + + + + Enterprise +
diff --git a/odoo/addons/base/data/ir_module_module.xml b/odoo/addons/base/data/ir_module_module.xml index 7579260be25..058a7880b3a 100644 --- a/odoo/addons/base/data/ir_module_module.xml +++ b/odoo/addons/base/data/ir_module_module.xml @@ -245,5 +245,15 @@ /base/static/img/icons/website_twitter_wall.png + + payment_sepa_direct_debit + Sepa Direct Debit Payment Acquirer + Checkout with SEPA Direct Debit + + OEEL-1 + Odoo S.A. + + /base/static/img/icons/payment_sepa_direct_debit.png + diff --git a/odoo/addons/base/static/img/icons/payment_sepa_direct_debit.png b/odoo/addons/base/static/img/icons/payment_sepa_direct_debit.png new file mode 100644 index 0000000000000000000000000000000000000000..aec41dd16588bf1535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