Odoo Help


adding badge with java script to images not removeable ?

joachim grubelnik
on 3/2/15, 10:29 AM 846 views


I added an option at the customize menü where i added a class which loads a badge :after the image. 

when i click my snippet option this adds the class and after the reload of the page the JS adds the class and the badge to the image --> OK 

the JS --> myjs.js:

 $(document).ready( function() { $('img.img_badge-header').after('<img src="/website_theme/static/src/img/badge/img_badge-test.png" class="img_badge-header-after">'); });

the CSS:

.img_badge-header-after {

//background-color: @bg_yellow;

width: 100px;

height: 200px;

position: absolute;

top: 70%;

right: 10%;


load in website_template.xml JS :

<template id="assets_frontend" inherit_id="website.assets_frontend" name="my theme">

<xpath expr="." position="inside"> <script src="/website/static/src/js/myjs.js"></script>

<!-- <script type="text/javascript" src="/website/static/src/js/sticky.js"></script>-->



the Snippet Option: 

<xpath expr="//div[@data-snippet-option-id='transform']//li" position="after">

<li class="dropdown-submenu" data-required="true"> <a tabindex="-1" href="#">Badges</a> <ul class="dropdown-menu"> <li class="dropdown-submenu"> <a tabindex="-2" href="#">Positionierung</a> <ul class="dropdown-menu"> <li data-value='pfot_img_badge-header'><a>Header-Badge</a></li> </ul> </li> </ul> </li>

now i ihave the problem that the badge is shown all the time, is this a caching problem or is the java script not loaded again  ? 

Is it written into database ? or how can i remove the badge again  ?

cheers joe

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 3/2/15, 10:29 AM
Seen: 846 times
Last updated: 3/16/15, 8:10 AM