Odoo Help

Welcome!

This community 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.

0

javascript in widget openerp

By
lam a bao
on 1/22/14, 12:06 AM 1,389 views

Hi everyone

I have code javascript : static/src/js/cvs_quoations.js:

                  openerp.cnd_quotations = function (openerp)
                 {
                    openerp.web.form.widgets.add('test', 'openerp.cnd_quotations.Mywidget');
                    openerp.cnd_quotations.Mywidget = openerp.web.form.FieldChar.extend(
                   {
                       template : "test",
                      init: function (view, code) {
                      var self = this;
                    this._super(view, code);
                   this.rpc('/cnd_quotations/_getdataproductCutByIdSales',{}).done(function(result){
                          $("div#showdata").html("ok men")

              })
    }
});

}

view widget : static/src/xml/cvs_quotations.xml :

          <?xml version="1.0" encoding="UTF-8"?>
        <templates id="template" xml:space="preserve">
        <t t-name="test">
      <html>
         <body>

             <div style="float:left">
               <table style="width:500px;text-align:center" border="1">
                   <thread>
                       <tr>
                            <th colspan="5" style="text-align:center">Ok 1</th>
                       </tr>
                       <tr>
                           <th style="text-align:center">Ký Hiệu</th>
                           <th style="text-align:center">Ngang</th>
                           <th style="text-align:center">Cao</th>
                           <th style="text-align:center">Số Bộ</th>
                       </tr>
                   </thread>
               </table>
        </div>
        <div style="float:left;width:50px;min-height:100px"></div>
        <div style="float:left">
                <table style="width:500px" border="1">
                    <thread>
                        <th style="text-align:center">Vật Tư Sản Xuất</th>
                        <th style="text-align:center">Số Lượng</th>
                        <th style="text-align:center">Giá</th>
                    </thread>
                    <tbody>
                        <tr>
                            <td><div id="showdata"></div></td>

                        </tr>
                    </tbody>
                </table>
        </div>
        <div style="clear:left"></div>

    </body>
</html>    
</t>
</templates>

but it not show text "ok men" on view of widget

can you 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 community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 1/22/14, 12:06 AM
Seen: 1389 times
Last updated: 3/16/15, 8:10 AM