Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
2 Ответы
4414 Представления

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.

Аватар
Отменить

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

Лучший ответ

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

Аватар
Отменить

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.

Лучший ответ
<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>
Аватар
Отменить