0

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?

3
  • What thing you are particularly wanna know about? Commented Jul 7, 2021 at 9:24
  • Inheriting template and widgets? Commented Jul 7, 2021 at 9:25
  • you have a list or source document not? Commented Jul 7, 2021 at 9:27

1 Answer 1

2

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',
   ...
Sign up to request clarification or add additional context in comments.

1 Comment

(re edit discussion - last code block is definitely Python - albeit incorrectly indented, I now realise.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.