Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Odoo error in the form xml

Tags:

xml

I work on Odoo, I want to create a module, installation is ok but when I wan to upgrade with a xml file, I have some errors. Here xml code:

<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<data>
<record id="cym_form" model="ir.ui.view"> 
<field name="name">Import Bank Statements</field>
<field name="model">account.bank.statement.import</field>
<field name="priority">1</field>
<field name="arch" type="xml">
                        <field name="cym_tag"/>
            <field name="modules" widget="one2many_tag"/>
</field>
</record>
</data>
</openerp>

And here error:

ParseError: "Wrong value for ir.ui.view.type: 'data'" while parsing 
/home/production/odoo/addons/crm_cym/form_cym_view.xml:4, near
<record id="cym_form" model="ir.ui.view">
      <field name="name">CYM Tag</field>
      <field name="module">cym.tag</field>
      <field name="priority">1</field>
      <field name="arch" type="xml">
    <data><field name="cym_tag"/>
    <field name="modules" widget="one2many_tag"/>
      </data></field>
    </record>

If you have any ideas, I will be very grateful ! Thank you !

like image 431
Kraven Avatar asked Sep 01 '16 17:09

Kraven


1 Answers

The fields should be inside a form tag.

<form>
    <field name="cym_tag"/>
    <field name="modules" widget="one2many_tag"/>
</form>
like image 76
Kenly Avatar answered Sep 23 '22 01:09

Kenly