Legacy odoo.define JavaScript
A finding from the Migration Audit that flags legacy odoo.define() module patterns in your assets instead of the OWL framework.
What This Finding Means
The module registers JavaScript through odoo.define() and the legacy AMD-style module system rather than native ES modules and OWL components. Odoo has been migrating its web client to OWL and ES module imports.
Why It Matters
The legacy module loader has been progressively removed. Code that depends on require() calls and the old registry layout can stop resolving in newer versions, leaving widgets and actions silently broken on the client side.
Old Odoo Example
odoo.define('my.module', function(require) {
"use strict";
var core = require('web.core');
});Target Version Risk
- Odoo 15 and 16 — legacy layer present but discouraged
- Odoo 17 and later — legacy module resolution increasingly removed, higher break risk
Recommended Fix Direction
Rewrite the file as a native ES module that imports from @odoo/owl and uses the modern registries. Express UI as an OWL component and shared logic as a service, registering each through the appropriate registry category.
How to Verify Manually
Load the module in the target Odoo version, open the browser console, and exercise the views or buttons the script powers. Check for missing-module errors and confirm the component renders and reacts as expected.
Related Odoo Doctor Tool
The Migration Audit scans module assets for legacy JavaScript patterns and reports each file that still uses odoo.define().