title: How do I call a python function from Javascript file in Odoo v8 in a newly created module?
body: <p>I have created a new module in <code>Odoo v8</code> and I want to call a python function defined in the controllers folder of the module from a JavaScript file defined in <code>static/src/js</code>. </p>
  
  <p>I have tried the following:</p>
  
  <p>1.</p>
  
  <pre><code>function openerp_pos_models(instance){
  
  var myModel = new instance.web.Model('my.model'); 
  //code to call python method
  });
  </code></pre>
  
  <p>But on loading the page it shows <code>instance is not defined</code>.</p>
  
  <p>2.</p>
  
  <pre><code>var Users = new openerp.web.Model('res.users');
  </code></pre>
  
  <p>but this shows <code>Uncaught TypeError: Cannot read property 'Model' of undefined</code>.</p>