[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) <dbo@odoo.com>
This commit is contained in:
Juhil Somaiya
2019-06-12 10:07:44 +00:00
parent cba643bf2d
commit 4642a6fab8
2 changed files with 1 additions and 11 deletions
@@ -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:
@@ -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)