import odoo
from odoo import api, registry

odoo.tools.config['db_host'] = 'db'
odoo.tools.config['db_user'] = 'odoo'
odoo.tools.config['db_password'] = 'odoo'

db_name = 'dine360_restaurant_testing5'
print(f"Checking modules on: {db_name}")
try:
    reg = registry(db_name)
    with reg.cursor() as cr:
        env = api.Environment(cr, odoo.SUPERUSER_ID, {})
        modules = env['ir.module.module'].search([('state', '=', 'installed')])
        for m in modules:
            print(f"  Installed module: {m.name}")
except Exception as e:
    print(f"  Error: {e}")
