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

how to use <table> tag

By
philip
on 9/21/14, 11:49 PM 1,087 views

is there anyone know how to use <table> tag to the form view, below code is not working.

What we want to achieve is 8 columns, the first columns is the label and the rest 7 columns would be the fields.

thanks

    <record id="test_product_submenu_action" model="ir.actions.act_window">
        <field name="name">Products</field>
        <field name="res_model">test.product</field>
        <field name="view_type">form</field>
        <field name="view_mode">tree,form</field>
        <field name="help" type="html">
            <p class="oe_view_nocontent_create">Click Create to add a new Products record.</p>
        </field>        
    </record>

    <record id="test_product_form_view" model="ir.ui.view">
        <field name="name">test.product.form.vew</field>
        <field name="model">test.product</field>
        <field name="type">form</field>
        <field name="arch" type="xml" version="7.0">
            <form string="Product">
            <div>
            <table border="1">
            <tr>
                <td>
                    <field name="name"/>
                </td>
             </tr>
        </table>
            </div>
            </form>
        </field>
    </record>

Server Traceback (most recent call last):
  File "C:\Program Files (x86)\OpenERP 7.0-20140622-231040\Server\server\openerp\addons\web\session.py", line 89, in send
  File "C:\Program Files (x86)\OpenERP 7.0-20140622-231040\Server\server\.\openerp\netsvc.py", line 296, in dispatch_rpc
  File "C:\Program Files (x86)\OpenERP 7.0-20140622-231040\Server\server\.\openerp\service\web_services.py", line 622, in dispatch
  File "C:\Program Files (x86)\OpenERP 7.0-20140622-231040\Server\server\.\openerp\service\security.py", line 40, in check
  File "C:\Program Files (x86)\OpenERP 7.0-20140622-231040\Server\server\.\openerp\pooler.py", line 49, in get_pool
  File "C:\Program Files (x86)\OpenERP 7.0-20140622-231040\Server\server\.\openerp\pooler.py", line 33, in get_db_and_pool
  File "C:\Program Files (x86)\OpenERP 7.0-20140622-231040\Server\server\.\openerp\modules\registry.py", line 203, in get
  File "C:\Program Files (x86)\OpenERP 7.0-20140622-231040\Server\server\.\openerp\modules\registry.py", line 233, in new
  File "C:\Program Files (x86)\OpenERP 7.0-20140622-231040\Server\server\.\openerp\modules\loading.py", line 350, in load_modules
  File "C:\Program Files (x86)\OpenERP 7.0-20140622-231040\Server\server\.\openerp\modules\loading.py", line 256, in load_marked_modules
  File "C:\Program Files (x86)\OpenERP 7.0-20140622-231040\Server\server\.\openerp\modules\loading.py", line 187, in load_module_graph
  File "C:\Program Files (x86)\OpenERP 7.0-20140622-231040\Server\server\.\openerp\modules\loading.py", line 74, in <lambda>
  File "C:\Program Files (x86)\OpenERP 7.0-20140622-231040\Server\server\.\openerp\modules\loading.py", line 124, in _load_data
  File "C:\Program Files (x86)\OpenERP 7.0-20140622-231040\Server\server\.\openerp\tools\convert.py", line 959, in convert_xml_import
  File "C:\Program Files (x86)\OpenERP 7.0-20140622-231040\Server\server\.\openerp\tools\convert.py", line 852, in parse
  File "C:\Program Files (x86)\OpenERP 7.0-20140622-231040\Server\server\.\openerp\tools\convert.py", line 819, in _tag_record
  File "C:\Program Files (x86)\OpenERP 7.0-20140622-231040\Server\server\openerp\addons\base\ir\ir_model.py", line 944, in _update
  File "C:\Program Files (x86)\OpenERP 7.0-20140622-231040\Server\server\openerp\addons\base\ir\ir_ui_view.py", line 214, in write
  File "C:\Program Files (x86)\OpenERP 7.0-20140622-231040\Server\server\.\openerp\osv\orm.py", line 4282, in write
  File "C:\Program Files (x86)\OpenERP 7.0-20140622-231040\Server\server\.\openerp\osv\orm.py", line 1562, in _validate
except_orm: ('ValidateError', u'Error occurred while validating the field(s) arch: Invalid XML for View Architecture!')

to a beginner the above code is working if you encontered any issues for the table, be sure you have version="7.0" for instance <field name="arch" type="xml" version="7.0"> to avoid the above errors I have encountered.

0
Juan José Scarafía
On 9/22/14, 9:09 AM

Hi philip,

Try using some parameters in the <table> tag, like <table border=1>. May be this will show if the table is working or not, because what you have write its correct, there are no mistakes in that code.

Regards,

Juan José - Ing ADHOC

Thanks for the time, please see above already modified. I got error message: Invalid XML for View Architecture!, please help me.

philip
on 9/23/14, 2:50 AM

Thanks Sir, you right the code is working I forgot to put

instead of
philip
on 9/24/14, 2:58 AM
philip
on 10/5/14, 10:19 PM

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

1 follower(s)

Stats

Asked: 9/21/14, 11:49 PM
Seen: 1087 times
Last updated: 3/16/15, 8:10 AM