import logging from odoo import models, api _logger = logging.getLogger(__name__) class AccountPayment(models.Model): _inherit = "account.payment" @api.model def search(self, args, offset=0, limit=None, order=None, count=False): try: with open('/tmp/odoo_payment_search.log', 'a') as f: f.write(f"\\n{'='*40}\\n") f.write(f"ACCOUNT PAYMENT SEARCH CALLED\\n") f.write(f"Args: {args}\\n") f.write(f"Context: {self.env.context}\\n") f.write(f"{'='*40}\\n") except Exception as e: _logger.error(f"Failed to log to /tmp: {e}") return super(AccountPayment, self).search(args, offset, limit, order, count)