This question has been flagged
2 Replies
3743 Views

Hello.. I have database of suppliers and I want to create input form with general information about supplier and editable list of supplier products. I've tried to create form like this

<record id="view_partner_form" model="ir.ui.view">
        <field name="name">res.partner.form</field>
        <field name="model">res.partner</field>
        <field eval="1" name="priority"/>
        <field name="arch" type="xml">
            <form string="Partners" version="7.0">
            <sheet>
                <group>
                    <group>
                        <field name="company_name"/>
                        <field name="address"/>
                        <field name="website" widget="url"/>
                        ......
                                                    ......
                    </group>
                </group>
                <notebook>
                  <page string="Products">
                  <field name="products_line">  
                    <tree string="Products">
                        <field name="products"/>
                        <field name="price"/>
                    </tree>
                  </field>
                   </page>  
                </notebook>
               </sheet>
             </form>
        </field>
 </record>

But it gives error - Invalid XML for view Architecture or show nothing I think it's related to class description in python code, but I don't what exactly os this.

Avatar
Discard

Are you trying to add some fields to res.partner?

You should post traceback (error list) as well. Without it no one can help you.

you have to give editable="bottom" inside that tree tag, and see whether there is any change

Best Answer

Try to look at the error log so that you will know what is invalid in your xml.. :D

Avatar
Discard

More precisely, look at the server error log: it will display a traceback not shown on the webclient, telling the exact cause and the xml file plus line number where the problem is.

Best Answer
<record id="view_partner_form" model="ir.ui.view">
        <field name="name">res.partner.form</field>
        <field name="model">res.partner</field>
        <field eval="1" name="priority"/>
        <field name="arch" type="xml">
            <form string="Partners" version="7.0">
            <sheet>
                <group>
                    <group>
                        <field name="company_name"/>
                        <field name="address"/>
                        <field name="website" widget="url"/>
                        ......
                                                    ......
                    </group>
                </group>
                <notebook>
                  <page string="Products">
                  <field name="products_line">  
                    <tree string="Products" editable="bottom">
                        <field name="products"/>
                        <field name="price"/>
                    </tree>
                  </field>
                   </page>  
                </notebook>
               </sheet>
             </form>
        </field>
 </record>
Avatar
Discard