-
-
Save ppa-odoo/73c091e2fa4a4341dcb485ab6f0920ba to your computer and use it in GitHub Desktop.
REF LINK: https://www.odoo.com/forum/help-1/question/odoo10-how-to-inherit-templates-of-web-module-119140#answer-119142 | |
This is main template: | |
<template id="template" xml:space="preserve"> | |
<t t-name="DemoExample"> | |
<div class="demo-one"> | |
<p>odoo</p> | |
</div> | |
</t> | |
</template> | |
How To Inherit | |
---------------------- | |
Template file :-> demo_template.xml | |
<template id="template" xml:space="preserve"> | |
<t t-name="DemoExample" t-extend="DemoExample"> | |
<t t-jquery='.demo-one' t-operation='replace'> | |
<p>Your Company Name</p> | |
</t> | |
</t> | |
</template> | |
----------------------------------------------------- | |
<!- Loaded XML files inside java script code --> | |
----------------------------------------------------- | |
JS file :--> demo_example.js | |
------------------------------------------------------------------------- | |
put the following JS Code in demo_example.js file: | |
------------------------------------------------------------------------- | |
odoo.define('module_name.name_of_fetures', function (require) { | |
'use strict'; | |
var core = require('web.core'); | |
var ajax = require('web.ajax'); | |
var qweb = core.qweb; | |
ajax.loadXML('/module_name/static/src/xml/demo_template.xml', qweb); | |
}); | |
----------------------------------- | |
Loading of Javascript file | |
----------------------------------- | |
<template id="demo_example_ext_js" name="Demo Example Ext Js" inherit_id="web.assets_backend"> | |
<xpath expr="." position="inside"> | |
<script type="text/javascript" src="/module_name/static/js/demo_example.js"></script> | |
</xpath> | |
</template> |
@jp-sft glad to helpful for you!
this way is working in odoo 15 ?
@HamidAbdalla123
Yes it's working on odoo 15, if you have any issue tell us maybe we can help.
Just one more thing .. if you want to include a js file on any assets for instance: web.assets_backend you will have to add this property on manifest.py:
'assets': {
'web.assets_backend': [
'module_name/static/src/js/js_file.js',
],
}
this way is working in odoo 15 ?
structure has been changed, so you have to check manifest.py file,
how to set the JS, XML, CSS, SCSS file
document
https://www.odoo.com/documentation/15.0/developer/reference/frontend/assets.html#bundles
@OtmanGX Thank you!
@HamidAbdalla123
Here are some resources that I previously bookmarked:
https://codingdodo.com/tag/owl/
https://www.oocademy.com/v15.0/tutorials
https://www.cybrosys.com/search/?q=owl
@OtmanGX Thank you very much for sharing with us!
it will be very useful for the other developer
@HamidAbdalla123 please check it above link.
hi all i want to change tooltip question marker to "!" how to inherit templates to change this on
there is source code in: addons/web/static/src/views/form/form_lable.xml
and source code is:
<t t-name="web.FormLabel">
<label class="o_form_label" t-att-for="props.id" t-att-class="className" >
<t t-esc="props.string"/><sup class="text-info p-1" t-if="hasTooltip" t-att="{'data-tooltip-template': 'web.FieldTooltip', 'data-tooltip-info': tooltipInfo, 'data-tooltip-touch-tap-to-show': 'true'}">?</sup>
</label>
</t>
please help me tnx
Thank lot for this!!