Odoo Help


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.


javascript in widget openerp

lam a bao
on 1/22/14, 12:06 AM 1,360 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 ?

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)


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