ylhc_dynamic_resource
by YLHC Technology https://www.ylhctec.com , co. https://www.ylhctec.com , ltd. https://www.ylhctec.com$ 10.96
ylhc_dynamic_resource lets you add and change frontend and backend code — CSS, JavaScript, QWeb templates and Python methods — straight from the Odoo interface. Everything is stored in the database and injected into the right asset bundle on the fly, so you see results without editing files, rebuilding the addon or restarting the server. It is the live-asset backbone behind ylhc_studio, and a standalone power tool for admins and developers.
Why this module?
No restarts, no deploysSaving a resource clears the asset cache and rebuilds the bundle automatically. Tweak a stylesheet or an OWL widget and refresh — the change is live. |
Four resource typesCSS / LESS / SCSS, JavaScript (real Odoo modules, transpiled on the fly), QWeb templates and Python that becomes a genuine method on any model. |
Override what already shipsReplace or disable any existing asset by URL — glob wildcards included — instead of forking a whole addon just to change one file. |
Safe to debugA per-session switch turns all (or selected) dynamic resources off so you can tell your injected code apart from the stock behaviour in seconds. |
What you can inject
| Resource | What it does |
|---|---|
| CSS / LESS / SCSS | Append styles to any bundle. Great for theme tweaks, hiding fields and restyling views. |
| JavaScript | Full OWL components and patches. Odoo-module sources are transpiled and either packed into one file or kept as single files. |
| QWeb templates | Register or extend templates at runtime; the name is read straight from your markup. |
| Python methods |
Attach a snippet as a real method on any model, honouring @api.depends,
@api.onchange, @api.constrains and more. Re-registered on server start.
|
Key features
- Bundle binding — target
web.assets_backend,web.assets_frontendor any custom bundle per resource. - Asset override — replace or disable existing files by exact URL or glob pattern (
/web/static/src/legacy/*). - Automatic cache rebuild — create, edit or delete a resource and the affected bundles regenerate themselves.
- Python execution helper — a Run button reports status, result and timestamp without leaving the form.
- Rich eval context — snippets see
env,self,user,Command,datetime,float_compareand more. - Smart naming — resource names auto-fill from
odoo.define,@odoo-module alias,t-nameordef. - Session ignore switch — disable everything or specific names/types for the current session only.
- Active flag & constraints — toggle resources on/off; unique names and target URLs keep the set clean.
See it in action
Add a resource — write the code, pick the bundle, save. It is injected and live on the next load, no restart.
Good to know
- Requires developer access; managed under the Dynamic Resource technical menus.
- Stored in the database, so resources travel with your backups and are easy to move between environments.
- Python snippets run through Odoo's
safe_eval; treat this as an admin/developer tool, not an end-user feature. - Works on Odoo 19 and needs no other YLHC module — it pairs naturally with ylhc_studio.
Recommended modules
ylhc_studioBuild models, views and logic visually. Uses this module as its live-asset engine. |
ylhc_dynamic_fieldsAdd dynamic fields and views at runtime — a natural companion to dynamic code. |
ylhc_sub_formEmbed a real, editable form view inside any OWL screen you inject as a JS resource. |
ylhc_dynamic_dependencyA load-time resolver that keeps undeclared inheritance and relations from crashing. |
Support
Contact us at www.ylhctec.com.
© YLHC Technology, co., ltd.
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Lines of code | 1096 |
| Technical Name |
ylhc_dynamic_resource |
| License | OPL-1 |
| Website | https://www.ylhctec.com |
Odoo Proprietary License v1.0 This software and associated files (the "Software") may only be used (executed, modified, executed after modifications) if you have purchased a valid license from the authors, typically via Odoo Apps, or if you have received a written agreement from the authors of the Software (see the COPYRIGHT file). You may develop Odoo modules that use the Software as a library (typically by depending on it, importing it and using its resources), but without copying any source code or material from the Software. You may distribute those modules under the license of your choice, provided that this license is compatible with the terms of the Odoo Proprietary License (For example: LGPL, MIT, or proprietary licenses similar to this one). It is forbidden to publish, distribute, sublicense, or sell copies of the Software or modified copies of the Software. The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Please log in to comment on this module