import odoo import json def get_table_metadata(cr, table_name): cr.execute(""" SELECT column_name, data_type FROM information_schema.columns WHERE table_name = %s """, (table_name,)) return cr.fetchall() if __name__ == '__main__': db_name = 'lims_demo' registry = odoo.registry(db_name) with registry.cursor() as cr: metadata = {} tables = ['sale_order', 'sale_order_line', 'product_template', 'product_product'] for table in tables: metadata[table] = get_table_metadata(cr, table) print(json.dumps(metadata, indent=4))