19.0 vanilla

This commit is contained in:
Ernad Husremovic 2026-03-09 09:30:27 +01:00
parent d1963a3c3a
commit 2d3ee4855a
7430 changed files with 2687981 additions and 2965473 deletions

View file

@ -0,0 +1,32 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
# Import the payment provider modules with aliases to avoid circular import errors.
try:
import odoo.addons.payment_mercado_pago as mercado_pago
import odoo.addons.payment_stripe as stripe
except ModuleNotFoundError:
mercado_pago = None
stripe = None
class ResCountry(models.Model):
_inherit = 'res.country'
is_mercado_pago_supported_country = fields.Boolean(compute='_compute_provider_support')
is_stripe_supported_country = fields.Boolean(compute='_compute_provider_support')
@api.depends('code')
def _compute_provider_support(self):
for country in self:
country.is_stripe_supported_country = (
stripe is not None
and stripe.const.COUNTRY_MAPPING.get(
country.code, country.code
) in stripe.const.SUPPORTED_COUNTRIES
)
country.is_mercado_pago_supported_country = (
mercado_pago
and country.code in mercado_pago.const.SUPPORTED_COUNTRIES
)