mirror of
https://github.com/bringout/oca-ocb-core.git
synced 2026-04-20 12:32:02 +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
28 lines
955 B
Python
28 lines
955 B
Python
import secrets
|
|
import sys
|
|
import textwrap
|
|
|
|
from passlib.hash import pbkdf2_sha512
|
|
|
|
from odoo.cli import Command
|
|
from odoo.tools import config
|
|
|
|
|
|
class GenProxyToken(Command):
|
|
""" Generate and (re)set proxy access token in config file """
|
|
|
|
def generate_token(self, length=16):
|
|
token = secrets.token_hex(int(length / 2))
|
|
split_size = int(length / 4)
|
|
return '-'.join(textwrap.wrap(token, split_size))
|
|
|
|
def run(self, cmdargs):
|
|
self.parser.add_argument('-c', '--config', type=str, help="Specify an alternate config file")
|
|
self.parser.add_argument('--token-length', type=int, help="Token Length", default=16)
|
|
args, _ = self.parser.parse_known_args()
|
|
if args.config:
|
|
config.rcfile = args.config
|
|
token = self.generate_token(length=args.token_length)
|
|
config['proxy_access_token'] = pbkdf2_sha512.hash(token)
|
|
config.save()
|
|
sys.stdout.write(f'{token}\n')
|