I learn about Qweb and javascirpt in odoo through youtube channel and documnention, but it's too difficult, I can't understand how it works and the organizational structure and syntax. Is there any way you can help me?
-
What thing you are particularly wanna know about?Sakthi Priya– Sakthi Priya2021-07-07 09:24:45 +00:00Commented Jul 7, 2021 at 9:24
-
Inheriting template and widgets?Sakthi Priya– Sakthi Priya2021-07-07 09:25:22 +00:00Commented Jul 7, 2021 at 9:25
-
you have a list or source document not?Trinh Ngoc Hung– Trinh Ngoc Hung2021-07-07 09:27:53 +00:00Commented Jul 7, 2021 at 9:27
Add a comment
|
1 Answer
Introduction to javascript in odoo : https://www.youtube.com/watch?v=VuUMvzycXQY
Example of use in your module : my_module_custom
- In my_module_custom/static/src/js/myclientscript.js :
odoo.define('my_module_custom.hidebadgepill', function(require)
{
"use strict";
$(document).ready(function() {
$(function() {
//your js or jquery script , for instance :
$('.o_web_index_topbar_filters').find('.badge-pill').hide();
});
});
- in my_module_custom/views/assets_frontend.xml :
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="assets_frontend"
inherit_id="website.assets_frontend" name="Date Check">
<xpath expr="." position="inside">
<script type="text/javascript" src="/my_module_custom
/static/src/js/myclientscript.js"/>
</xpath>
</template>
</odoo>
- in my_module_custom/_manifest.py :
##-*- coding: utf-8 -*-
{
'name': 'my module custom name',
'version': '13.0.2.0.147',
...
'data': [
'views/assets_frontend.xml',
...
1 Comment
Jack Deeth
(re edit discussion - last code block is definitely Python - albeit incorrectly indented, I now realise.)