Odoo Help


javascript in widget openerp

lam a bao
on 1/22/14, 12:06 AM 1,819 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);
                          $("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">

             <div style="float:left">
               <table style="width:500px;text-align:center" border="1">
                            <th colspan="5" style="text-align:center">Ok 1</th>
                           <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>
        <div style="float:left;width:50px;min-height:100px"></div>
        <div style="float:left">
                <table style="width:500px" border="1">
                        <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>
                            <td><div id="showdata"></div></td>

        <div style="clear:left"></div>


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

can you help me ?

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

0 follower(s)


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