diff --git a/addons/account_payment/views/account_payment_menus.xml b/addons/account_payment/views/account_payment_menus.xml index 4e2dc85ce48..4c148cb7a88 100644 --- a/addons/account_payment/views/account_payment_menus.xml +++ b/addons/account_payment/views/account_payment_menus.xml @@ -5,8 +5,8 @@ id="payment_provider_menu" parent="account.root_payment_menu" sequence="10"/> - diff --git a/addons/payment/__manifest__.py b/addons/payment/__manifest__.py index 0a5b174bcad..48d8d24ed4d 100644 --- a/addons/payment/__manifest__.py +++ b/addons/payment/__manifest__.py @@ -7,7 +7,7 @@ 'summary': "The payment engine used by payment provider modules.", 'depends': ['portal'], 'data': [ - 'data/payment_icon_data.xml', + 'data/payment_method_data.xml', 'data/payment_provider_data.xml', 'data/payment_cron.xml', @@ -15,7 +15,7 @@ 'views/payment_templates.xml', 'views/payment_provider_views.xml', - 'views/payment_icon_views.xml', + 'views/payment_method_views.xml', 'views/payment_transaction_views.xml', 'views/payment_token_views.xml', # Depends on `action_payment_transaction_linked_to_token` 'views/res_partner_views.xml', diff --git a/addons/payment/data/payment_icon_data.xml b/addons/payment/data/payment_method_data.xml similarity index 74% rename from addons/payment/data/payment_icon_data.xml rename to addons/payment/data/payment_method_data.xml index b4cd2aed0c5..9f4f6cfc7d7 100644 --- a/addons/payment/data/payment_icon_data.xml +++ b/addons/payment/data/payment_method_data.xml @@ -1,181 +1,181 @@ - + 10 VISA - + 20 MasterCard - + 30 American Express - + 40 Discover - + 50 Diners Club International - + 60 Paypal - + 65 Rupay - + 70 Apple Pay - + 80 JCB - + 90 Maestro - + 100 Cirrus - + 110 UnionPay - + 120 Bancontact - + 130 Western Union - + 140 SEPA Direct Debit - + 150 iDEAL - + 160 WebMoney - + 170 Giropay - + 180 EPS - + 190 P24 - + 200 Codensa Easy Credit - + 210 KBC - + 220 M-Pesa - + 230 Airtel Money - + 240 MTN Mobile Money - + 250 Barter by Flutterwave - + 260 Sadad - + 270 Mada - + 280 BBVA Bancomer - + 280 CitiBanamex diff --git a/addons/payment/data/payment_provider_data.xml b/addons/payment/data/payment_provider_data.xml index e5f4b40c7eb..d7dcd7204e1 100644 --- a/addons/payment/data/payment_provider_data.xml +++ b/addons/payment/data/payment_provider_data.xml @@ -7,16 +7,16 @@ - @@ -26,12 +26,12 @@ - @@ -41,11 +41,11 @@ - @@ -57,14 +57,14 @@ file="payment_authorize/static/description/icon.png"/> - @@ -76,13 +76,13 @@ file="payment_buckaroo/static/description/icon.png"/> - @@ -100,14 +100,14 @@ file="payment_flutterwave/static/description/icon.png"/> - @@ -122,13 +122,13 @@ - @@ -137,20 +137,20 @@ - @@ -160,16 +160,16 @@ - @@ -179,14 +179,14 @@ - @@ -205,17 +205,17 @@ - @@ -228,15 +228,15 @@ See https://stripe.com/payments/payment-methods-guide See https://support.goteamup.com/hc/en-us/articles/115002089349-Which-cards-and-payment-types-can-I-accept-with-Stripe- --> - diff --git a/addons/payment/models/__init__.py b/addons/payment/models/__init__.py index ab4ea5e5113..ffb32ae6268 100644 --- a/addons/payment/models/__init__.py +++ b/addons/payment/models/__init__.py @@ -1,8 +1,8 @@ # Part of Odoo. See LICENSE file for full copyright and licensing details. from . import ir_http +from . import payment_method from . import payment_provider -from . import payment_icon from . import payment_token from . import payment_transaction from . import res_company diff --git a/addons/payment/models/payment_icon.py b/addons/payment/models/payment_method.py similarity index 68% rename from addons/payment/models/payment_icon.py rename to addons/payment/models/payment_method.py index 4240f14b935..095548f1e9f 100644 --- a/addons/payment/models/payment_icon.py +++ b/addons/payment/models/payment_method.py @@ -3,18 +3,18 @@ from odoo import fields, models -class PaymentIcon(models.Model): - _name = 'payment.icon' - _description = 'Payment Icon' +class PaymentMethod(models.Model): + _name = 'payment.method' + _description = 'Payment Method' _order = 'sequence, name' name = fields.Char(string="Name") provider_ids = fields.Many2many( string="Providers", comodel_name='payment.provider', - help="The list of providers supporting this payment icon") + help="The list of providers supporting this payment method") image = fields.Image( string="Image", max_width=64, max_height=64, - help="This field holds the image used for this payment icon, limited to 64x64 px") + help="This field holds the image used for this payment method, limited to 64x64 px") image_payment_form = fields.Image( string="Image displayed on the payment form", related='image', store=True, max_width=45, max_height=30) diff --git a/addons/payment/models/payment_provider.py b/addons/payment/models/payment_provider.py index e2128ca620c..98fbaad1eec 100644 --- a/addons/payment/models/payment_provider.py +++ b/addons/payment/models/payment_provider.py @@ -47,8 +47,8 @@ class PaymentProvider(models.Model): related='company_id.currency_id', help="The main currency of the company, used to display monetary fields.", ) - payment_icon_ids = fields.Many2many( - string="Supported Payment Icons", comodel_name='payment.icon') + payment_method_ids = fields.Many2many( + string="Supported Payment Methods", comodel_name='payment.method') allow_tokenization = fields.Boolean( string="Allow Saving Payment Methods", help="This controls whether customers can save their payment methods as payment tokens.\n" @@ -194,7 +194,7 @@ class PaymentProvider(models.Model): show_credentials_page = fields.Boolean(compute='_compute_view_configuration_fields') show_allow_tokenization = fields.Boolean(compute='_compute_view_configuration_fields') show_allow_express_checkout = fields.Boolean(compute='_compute_view_configuration_fields') - show_payment_icon_ids = fields.Boolean(compute='_compute_view_configuration_fields') + show_payment_method_ids = fields.Boolean(compute='_compute_view_configuration_fields') show_pre_msg = fields.Boolean(compute='_compute_view_configuration_fields') show_pending_msg = fields.Boolean(compute='_compute_view_configuration_fields') show_auth_msg = fields.Boolean(compute='_compute_view_configuration_fields') @@ -246,7 +246,7 @@ class PaymentProvider(models.Model): - `show_credentials_page`: Whether the "Credentials" notebook page should be shown. - `show_allow_tokenization`: Whether the `allow_tokenization` field should be shown. - `show_allow_express_checkout`: Whether the `allow_express_checkout` field should be shown. - - `show_payment_icon_ids`: Whether the `payment_icon_ids` field should be shown. + - `show_payment_method_ids`: Whether the `payment_method_ids` field should be shown. - `show_pre_msg`: Whether the `pre_msg` field should be shown. - `show_pending_msg`: Whether the `pending_msg` field should be shown. - `show_auth_msg`: Whether the `auth_msg` field should be shown. @@ -263,7 +263,7 @@ class PaymentProvider(models.Model): 'show_credentials_page': True, 'show_allow_tokenization': True, 'show_allow_express_checkout': True, - 'show_payment_icon_ids': True, + 'show_payment_method_ids': True, 'show_pre_msg': True, 'show_pending_msg': True, 'show_auth_msg': True, diff --git a/addons/payment/security/ir.model.access.csv b/addons/payment/security/ir.model.access.csv index f132de0f6d3..13cb556be90 100644 --- a/addons/payment/security/ir.model.access.csv +++ b/addons/payment/security/ir.model.access.csv @@ -2,8 +2,8 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink access_payment_link_wizard,access_payment_link_wizard,payment.model_payment_link_wizard,base.group_user,0,0,0,0 payment_provider_onboarding_wizard,payment.provider.onboarding.wizard,model_payment_provider_onboarding_wizard,base.group_system,1,1,1,0 payment_provider_system,payment.provider.system,model_payment_provider,base.group_system,1,1,1,1 -payment_icon_all,payment.icon.all,model_payment_icon,,1,0,0,0 -payment_icon_system,payment.icon.system,model_payment_icon,base.group_system,1,1,1,1 +payment_method_all,payment.method.all,model_payment_method,,1,0,0,0 +payment_method_system,payment.method.system,model_payment_method,base.group_system,1,1,1,1 payment_token_all,payment.token.all,model_payment_token,,1,0,0,0 payment_token_system,payment.token.system,model_payment_token,base.group_system,1,1,1,1 payment_transaction_all,payment.transaction.all,model_payment_transaction,,1,0,0,0 diff --git a/addons/payment/static/src/js/payment_form_mixin.js b/addons/payment/static/src/js/payment_form_mixin.js index 5d6ddb7de57..dc17276b08c 100644 --- a/addons/payment/static/src/js/payment_form_mixin.js +++ b/addons/payment/static/src/js/payment_form_mixin.js @@ -462,7 +462,7 @@ odoo.define('payment.payment_form_mixin', require => { //-------------------------------------------------------------------------- /** - * Hide all extra payment icons of the provider linked to the clicked button. + * Hide all extra payment method icons of the provider linked to the clicked button. * * Called when clicking on the "show less" button. * @@ -475,14 +475,14 @@ odoo.define('payment.payment_form_mixin', require => { ev.stopPropagation(); // Hide the extra payment icons, and the "show less" button const $itemList = $(ev.currentTarget).parents('ul'); - const maxIconNumber = $itemList.data('max-icons'); + const maxIconNumber = $itemList.data('max-icons-displayed'); $itemList.children('li').slice(maxIconNumber).addClass('d-none'); // Show the "show more" button $itemList.find('a[name="o_payment_icon_more"]').parents('li').removeClass('d-none'); }, /** - * Display all the payment icons of the provider linked to the clicked button. + * Display all the payment methods icons of the provider linked to the clicked button. * * Called when clicking on the "show more" button. * @@ -493,7 +493,7 @@ odoo.define('payment.payment_form_mixin', require => { _onClickMorePaymentIcons: ev => { ev.preventDefault(); ev.stopPropagation(); - // Display all the payment icons, and the "show less" button + // Display all the payment methods icons, and the "show less" button $(ev.currentTarget).parents('ul').children('li').removeClass('d-none'); // Hide the "show more" button $(ev.currentTarget).parents('li').addClass('d-none'); diff --git a/addons/payment/views/payment_icon_views.xml b/addons/payment/views/payment_method_views.xml similarity index 64% rename from addons/payment/views/payment_icon_views.xml rename to addons/payment/views/payment_method_views.xml index 85e4244c896..760dcad522e 100644 --- a/addons/payment/views/payment_icon_views.xml +++ b/addons/payment/views/payment_method_views.xml @@ -1,11 +1,11 @@ - - payment.icon.form - payment.icon + + payment.method.form + payment.method - + @@ -21,9 +21,9 @@ - - payment.icon.tree - payment.icon + + payment.method.tree + payment.method @@ -32,13 +32,13 @@ - - Payment Icons - payment.icon + + Payment Methods + payment.method tree,form - Create a payment icon + Create a payment method diff --git a/addons/payment/views/payment_provider_views.xml b/addons/payment/views/payment_provider_views.xml index 65d7de7d605..8fa8eb9784a 100644 --- a/addons/payment/views/payment_provider_views.xml +++ b/addons/payment/views/payment_provider_views.xml @@ -19,7 +19,7 @@ - + @@ -79,7 +79,7 @@ - + diff --git a/addons/payment/views/payment_templates.xml b/addons/payment/views/payment_templates.xml index 8380c257442..8fd3355fcde 100644 --- a/addons/payment/views/payment_templates.xml +++ b/addons/payment/views/payment_templates.xml @@ -93,7 +93,7 @@ - + - + - - - + + + - - + + - - - + + + t-att-title="payment_method.name"/> - + - + + t-att-title="', '.join([pm.name for pm in provider.payment_method_ids[MAX_ICONS_DISPLAYED:]])"> show more diff --git a/addons/payment_alipay/data/payment_provider_data.xml b/addons/payment_alipay/data/payment_provider_data.xml index 095da718061..d73c712949f 100644 --- a/addons/payment_alipay/data/payment_provider_data.xml +++ b/addons/payment_alipay/data/payment_provider_data.xml @@ -7,13 +7,13 @@ - alipay diff --git a/addons/payment_authorize/models/payment_provider.py b/addons/payment_authorize/models/payment_provider.py index d0934cf9f34..5866ed64cf6 100644 --- a/addons/payment_authorize/models/payment_provider.py +++ b/addons/payment_authorize/models/payment_provider.py @@ -74,16 +74,16 @@ class PaymentProvider(models.Model): def _onchange_authorize_payment_method_type(self): if self.authorize_payment_method_type == 'bank_account': self.display_as = _("Bank (powered by Authorize)") - self.payment_icon_ids = [Command.clear()] + self.payment_method_ids = [Command.clear()] else: self.display_as = _("Credit Card (powered by Authorize)") - self.payment_icon_ids = [Command.set([self.env.ref(icon_xml_id).id for icon_xml_id in ( - 'payment.payment_icon_cc_maestro', - 'payment.payment_icon_cc_mastercard', - 'payment.payment_icon_cc_discover', - 'payment.payment_icon_cc_diners_club_intl', - 'payment.payment_icon_cc_jcb', - 'payment.payment_icon_cc_visa', + self.payment_method_ids = [Command.set([self.env.ref(pm_xml_id).id for pm_xml_id in ( + 'payment.payment_method_maestro', + 'payment.payment_method_mastercard', + 'payment.payment_method_discover', + 'payment.payment_method_diners_club_intl', + 'payment.payment_method_jcb', + 'payment.payment_method_visa', )])] # === ACTION METHODS ===# diff --git a/addons/payment_custom/models/payment_provider.py b/addons/payment_custom/models/payment_provider.py index ab13256569f..7b8888fd4d0 100644 --- a/addons/payment_custom/models/payment_provider.py +++ b/addons/payment_custom/models/payment_provider.py @@ -38,7 +38,7 @@ class PaymentProvider(models.Model): super()._compute_view_configuration_fields() self.filtered(lambda p: p.code == 'custom').update({ 'show_credentials_page': False, - 'show_payment_icon_ids': False, + 'show_payment_method_ids': False, 'show_pre_msg': False, 'show_done_msg': False, 'show_cancel_msg': False, diff --git a/addons/payment_ogone/data/payment_provider_data.xml b/addons/payment_ogone/data/payment_provider_data.xml index cfc80d98e2d..963c7020220 100644 --- a/addons/payment_ogone/data/payment_provider_data.xml +++ b/addons/payment_ogone/data/payment_provider_data.xml @@ -8,13 +8,13 @@ type="base64" file="payment_ogone/static/description/icon.png"/> - ogone diff --git a/addons/payment_payulatam/data/payment_provider_data.xml b/addons/payment_payulatam/data/payment_provider_data.xml index fc4ac5e61b2..9f64e40894b 100644 --- a/addons/payment_payulatam/data/payment_provider_data.xml +++ b/addons/payment_payulatam/data/payment_provider_data.xml @@ -9,13 +9,13 @@ file="payment_payulatam/static/description/icon.png"/> - payulatam diff --git a/addons/payment_payumoney/data/payment_provider_data.xml b/addons/payment_payumoney/data/payment_provider_data.xml index 2704e840036..55de9c87235 100644 --- a/addons/payment_payumoney/data/payment_provider_data.xml +++ b/addons/payment_payumoney/data/payment_provider_data.xml @@ -10,12 +10,12 @@ - payumoney diff --git a/addons/payment_stripe/models/payment_transaction.py b/addons/payment_stripe/models/payment_transaction.py index 2fdd3f5ee23..4fc26b1c152 100644 --- a/addons/payment_stripe/models/payment_transaction.py +++ b/addons/payment_stripe/models/payment_transaction.py @@ -55,12 +55,12 @@ class PaymentTransaction(models.Model): :rtype: dict """ # Filter payment method types by available payment method - existing_pms = [pm.name.lower() for pm in self.env['payment.icon'].search([])] - linked_pms = [pm.name.lower() for pm in self.provider_id.payment_icon_ids] + existing_pms = [pm.name.lower() for pm in self.env['payment.method'].search([])] + linked_pms = [pm.name.lower() for pm in self.provider_id.payment_method_ids] pm_filtered_pmts = filter( lambda pmt: pmt.name == 'card' - # If the PM (payment.icon) record related to a PMT doesn't exist, don't filter out the - # PMT because the user couldn't even have linked it to the provider in the first place. + # If the PM record related to a PMT doesn't exist, don't filter out the PMT because the + # user couldn't even have linked it to the provider in the first place. or (pmt.name in linked_pms or pmt.name not in existing_pms), PAYMENT_METHOD_TYPES ) diff --git a/addons/payment_stripe/tests/common.py b/addons/payment_stripe/tests/common.py index d92ea769d0f..ba61d6d690a 100644 --- a/addons/payment_stripe/tests/common.py +++ b/addons/payment_stripe/tests/common.py @@ -13,7 +13,7 @@ class StripeCommon(PaymentCommon): 'stripe_secret_key': 'sk_test_KJtHgNwt2KS3xM7QJPr4O5E8', 'stripe_publishable_key': 'pk_test_QSPnimmb4ZhtkEy3Uhdm4S6J', 'stripe_webhook_secret': 'whsec_vG1fL6CMUouQ7cObF2VJprLVXT5jBLxB', - 'payment_icon_ids': [(5, 0, 0)], + 'payment_method_ids': [(5, 0, 0)], }) cls.provider = cls.stripe diff --git a/addons/website_sale/views/sale_order_views.xml b/addons/website_sale/views/sale_order_views.xml index 104dba9fa10..eadf19f4c33 100644 --- a/addons/website_sale/views/sale_order_views.xml +++ b/addons/website_sale/views/sale_order_views.xml @@ -245,8 +245,8 @@ action="payment.action_payment_token" groups="base.group_no_one" parent="menu_ecommerce_settings"/> -
- Create a payment icon + Create a payment method