This question has been flagged
1 Reply
12264 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.

Avatar
Discard
Best Answer

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

Avatar
Discard
Author

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

Author

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

instead of
Author