From 4642a6fab8c0a315a81e41f56574377d4e5ac8fc Mon Sep 17 00:00:00 2001 From: Juhil Somaiya Date: Tue, 14 May 2019 10:25:18 +0000 Subject: [PATCH] [FIX] sale: activate online payment with all payment methods of config bar Previously, online payment option was only activated with options which are predefined such as (paypal, stripe or manual). but not with other payment acquirer settings so now online payment will be activated with all the options including 'Pay with another payment acquirer' Removed deadcode as following, method _on_save_payment_acquirer as sale_payment module is removed. method onchange_portal_confirmation_pay as the field module_sale_payment is removed. task-1945749 closes: #33384 Signed-off-by: Damien Bouvy (dbo) --- addons/sale/models/res_config_settings.py | 5 ----- addons/sale/wizard/payment_acquirer_onboarding_wizard.py | 7 +------ 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/addons/sale/models/res_config_settings.py b/addons/sale/models/res_config_settings.py index 3772549b5e1..fa56659c6e8 100644 --- a/addons/sale/models/res_config_settings.py +++ b/addons/sale/models/res_config_settings.py @@ -113,11 +113,6 @@ class ResConfigSettings(models.TransientModel): 'group_pricelist_item': False, }) - @api.onchange('portal_confirmation_pay') - def _onchange_portal_confirmation_pay(self): - if self.portal_confirmation_pay: - self.module_sale_payment = True - @api.onchange('use_quotation_validity_days') def _onchange_use_quotation_validity_days(self): if self.quotation_validity_days <= 0: diff --git a/addons/sale/wizard/payment_acquirer_onboarding_wizard.py b/addons/sale/wizard/payment_acquirer_onboarding_wizard.py index 96c7d66798f..0586551e156 100644 --- a/addons/sale/wizard/payment_acquirer_onboarding_wizard.py +++ b/addons/sale/wizard/payment_acquirer_onboarding_wizard.py @@ -27,17 +27,12 @@ class PaymentWizard(models.TransientModel): """ Override. """ self.env.company.set_onboarding_step_done('sale_onboarding_order_confirmation_state') - def _on_save_payment_acquirer(self, *args, **kwargs): - """ Override """ - self._install_module('sale_payment') - return super(PaymentWizard, self)._on_save_payment_acquirer(*args, **kwargs) - @api.multi def add_payment_methods(self, *args, **kwargs): self.env.company.sale_onboarding_payment_method = self.payment_method if self.payment_method == 'digital_signature': self.env.company.portal_confirmation_sign = True - if self.payment_method in ('paypal', 'stripe', 'manual'): + if self.payment_method in ('paypal', 'stripe', 'other', 'manual'): self.env.company.portal_confirmation_pay = True return super(PaymentWizard, self).add_payment_methods(*args, **kwargs)