Components
Slots
/** @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"/> |
<?xml version="1.0" encoding="utf-8"?> | |
<openerp> | |
<data> | |
<template id="assets_backend" name="custom assets" inherit_id="web.assets_backend"> | |
<xpath expr="." position="inside"> | |
<link rel="stylesheet" href="/custom_stuff/custom.css"/> | |
</xpath> | |
</template> | |
</data> | |
</openerp> |
{ | |
'name': 'Custom Settings for Odoo', | |
'category': 'Custom', | |
'description': """ | |
Custom Settings for Odoo | |
""", | |
'version': '1.0', | |
'data' : [ | |
'view.xml', | |
] |