[Step 1A, Step 1B] => Step 2 => Step 3 => Step 4
- Step 1A: create dev branch, add
owl_3_with_some_of_owl2, compatibility layer - Step 1B: prepare master by adding
owl2_with_some_owl3build, and replacing/rewriting unpatchable code
| { | |
| /** | |
| * Odoo Assets Analyser Script | |
| * | |
| * Last Update: august 29th, 2025 | |
| * Supported Odoo versions: > 16.0 in theory | |
| * | |
| * Instructions: | |
| * - copy paste it in the console, then press enter | |
| * - or, add it to a snippet (in source tab), then Ctrl+Enter |
We refactored the publicWidget system in the public (website/...) JavaScript codebase. The initial plan was to convert them to OWL components, but after some experiments, the idea was discarded (it did not feel right, and it would prevent serving pages without OWL in the future).
See:
web/static/src/public/interaction.jsSilent in the nest,
| /** @odoo-module **/ | |
| import { registry } from "@web/core/registry"; | |
| import { KeepLast } from "@web/core/utils/concurrency"; | |
| import { useService } from "@web/core/utils/hooks"; | |
| import { XMLParser } from "@web/core/utils/xml"; | |
| import { Model, useModel } from "@web/views/helpers/model"; | |
| import { ViewLayout } from "@web/views/view_layout"; | |
| // ----------------------------------------------------------------------------- |
This gist describes our current work at using native JS modules in Odoo, and what it implies for the source code and for the developer experience.
PR: odoo/odoo#63177 (still work in progress)
The current PR allows us to use native JS modules in odoo. It works. It is
| // This is a detailed explanation on the compiled code generated by the | |
| // t-widget directive for a given template: | |
| // <div><t t-widget="child" t-key="'somestring'" t-props="{flag:state.flag}"/></div> | |
| // | |
| // Hopefully, this may help someday some poor developer that has to maintain | |
| // this code! Good luck, my friend... | |
| // This is the virtual node representing the parent div | |
| let c1 = [], |
| <?xml version="1.0"?> | |
| <tree string="Product Variants" order="name desc,price asc"> | |
| <field name="default_code"/> | |
| <field name="name" order="1"/> | |
| <field name="attribute_value_ids" widget="many2many_tags"/> | |
| <field name="lst_price"/> | |
| <field name="price" invisible="not context.get('pricelist',False)"/> | |
| <field name="uom_id"/> | |
| <field name="ean13"/> | |
| <field name="state" invisible="1"/> |