Odoo Help


How can i load js ?

on 7/20/16, 2:58 AM 279 views

I am creating a website for Malayalam news.

I am loading the google js file in my module as my_filename.js

but i have an error google is undefined..so i add a if loop,

var t = null;

function LoadGoogle()


if(typeof google != 'undefined' && google && google.load)



google.load("elements", "1", {

packages: "transliteration"


function onLoad() {

var options = {

sourceLanguage: 'en',

destinationLanguage: ['ml'],

shortcutKey: 'ctrl+g',

transliterationEnabled: true


// Create an instance on TransliterationControl with the required

// options.

var control =

new google.elements.transliteration.TransliterationControl(options);

// Enable transliteration in the textfields with the given ids.

var ids = [ "transl2" ];


// Show the transliteration control which can be used to toggle between

// English and Hindi and also choose other destination language.








alert('in else');

// Retry later...

if(t) {



t = setTimeout(LoadGoogle, 10);




And my .xml is

<?xml version="1.0" encoding="utf-8" ?>



<template id="assets_backend" name="news_portal assets" inherit_id="web.assets_backend">

<xpath expr="link[last()]" position="after">

 <script type="text/javascript" src="http://www.google.com/jsapi"></script>

 <script type="text/javascript" src="/module_name/static/src/js/my_filename.js"></script>

<script type="text/css" src="/news_portal/static/src/css/news_portal.css"></script>





My objective is :

when i type a word in Manglish & leave a space i want that word in Malayalam.

Can any one help me?

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

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: 7/20/16, 2:58 AM
Seen: 279 times
Last updated: 7/20/16, 3:36 AM