Odoo Mindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.

Module: Website Payment

Entity: res.config.settings

Compute Method: _compute_providers_state

Inputs Method Outputs
paypal = self.env.ref('payment.payment_provider_paypal', raise_if_not_found=False)
stripe = self.env.ref('payment.payment_provider_stripe', raise_if_not_found=False)
for config in self:
            providers = config._get_activated_providers()
            first_provider = stripe if stripe and stripe in providers else providers[0] if providers else providers
            config.first_provider_label = _('Configure %s', first_provider.name)
            if len(providers) == 1 and providers == paypal:
                config.providers_state = 'paypal_only'
            elif len(providers) >= 1:
                config.providers_state = 'other_than_paypal'
            else:
                config.providers_state = 'none'

Back to entity