# -*- coding: utf-8 -*-
"""
Comprehensive blocking of ALL external Odoo service calls.
Only inherits from models that are guaranteed to exist in base Odoo.
"""

import logging
from odoo import api, models, fields

_logger = logging.getLogger(__name__)


# ============================================================
# Block Currency Rate Live Updates - Uses res.currency which always exists
# ============================================================

class ResCurrencyDisabled(models.Model):
    _inherit = 'res.currency'
    
    @api.model
    def _get_rates_from_provider(self, provider, date):
        """DISABLED: Return empty rates."""
        _logger.debug("Currency rate provider BLOCKED: provider=%s", provider)
        return {}


# ============================================================
# Block Gravatar - Uses res.partner which always exists
# ============================================================

class ResPartnerDisabled(models.Model):
    _inherit = 'res.partner'
    
    @api.model
    def _get_gravatar_image(self, email):
        """DISABLED: Return False to skip gravatar lookup."""
        _logger.debug("Gravatar lookup BLOCKED for email=%s", email)
        return False
