Last active
December 19, 2023 13:06
-
-
Save ppa-odoo/73c091e2fa4a4341dcb485ab6f0920ba to your computer and use it in GitHub Desktop.
Odoo: How to inherit <templates> of web module?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
@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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
document
https://www.odoo.com/documentation/15.0/developer/reference/frontend/assets.html#bundles