mirror of
https://github.com/bringout/oca-ocb-core.git
synced 2026-04-20 00:12:07 +02:00
Add 19 payment provider modules needed by the sale module:
payment_adyen, payment_aps, payment_asiapay, payment_authorize,
payment_buckaroo, payment_demo, payment_dpo, payment_flutterwave,
payment_iyzico, payment_mercado_pago, payment_mollie, payment_nuvei,
payment_paymob, payment_paypal, payment_razorpay, payment_redsys,
payment_stripe, payment_worldline, payment_xendit
Add 3 IoT modules needed for point_of_sale:
iot_base, iot_box_image, iot_drivers
Note: Stripe test API keys replaced with placeholders.
🤖 assisted by claude
38 lines
840 B
Python
38 lines
840 B
Python
|
|
from io import StringIO
|
|
|
|
import logging
|
|
import sys
|
|
|
|
from odoo.addons.iot_drivers.tools.system import IS_TEST
|
|
|
|
_logger = logging.getLogger(__name__)
|
|
|
|
|
|
class ExceptionLogger:
|
|
"""
|
|
Redirect any unhandled python exception to the logger to keep track of them in the log file.
|
|
"""
|
|
def __init__(self):
|
|
self._buffer = StringIO()
|
|
|
|
def write(self, message):
|
|
self._buffer.write(message)
|
|
if message.endswith('\n'):
|
|
self._flush_buffer()
|
|
|
|
def _flush_buffer(self):
|
|
self._buffer.seek(0)
|
|
_logger.error(self._buffer.getvalue().rstrip('\n'))
|
|
self._buffer = StringIO() # Reset the buffer
|
|
|
|
def flush(self):
|
|
if self._buffer.tell() > 0:
|
|
self._flush_buffer()
|
|
|
|
def close(self):
|
|
self.flush()
|
|
|
|
|
|
if not IS_TEST:
|
|
sys.stderr = ExceptionLogger()
|