import odoo

def get_view_arch(cr, view_id):
    cr.execute("SELECT arch_db FROM ir_ui_view WHERE id = %s", (view_id,))
    return cr.fetchone()[0]

if __name__ == '__main__':
    db_name = 'lims_demo'
    registry = odoo.registry(db_name)
    with registry.cursor() as cr:
        env = odoo.api.Environment(cr, odoo.SUPERUSER_ID, {})
        view = env.ref('sale.view_order_form')
        print(f"View ID: {view.id}")
        print(get_view_arch(cr, view.id))