This question has been flagged
4 Replies
19225 Views

I just created a module using this code :

<record id="cym_form" model="ir.ui.view">
      <field name="name">CYM Tag</field>
      <field name="model">cym.tag</field>
      <field name="priority">1</field>
      <field name="arch" type="xml">
	<data><field name="cym_tag"/>
	<field name="modules" widget="one2many_tags"/>
      </data></field>
    </record>

And when I try to istall it I get this error :

ParseError: "Wrong value for ir.ui.view.type: 'data'" while parsing /home/production/odoo/addons/crm_cym/form_cym_view.xml:4

I really don't understand where it came from. Is it the use of wigdet ? The model ?

Here is my py code :

class ir_module(osv.osv):
    _inherit = 'ir.module.module'
    _columns = {
        'tag_id': fields.many2one('cym.tag', 'tag_name'),
    }

class cym_tag(osv.osv):
    _name = 'cym.tag'
    _order = 'name asc'

    _columns = {
        'tag_name': fields.char(u'Nom du Tag', size=128, required=True),
        'modules': fields.one2many('ir.module.module', 'tag_id', 'Modules'),
    }

Avatar
Discard
Best Answer

I think you use data tag  after <field name="arch" type="xml">.
You can use below code-

<record id="cym_form" model="ir.ui.view">
      <field name="name">CYM Tag</field>
      <field name="model">cym.tag</field>
      <field name="priority">1</field>
      <field name="arch" type="xml">
	<form><field name="cym_tag"/>
	<field name="modules" widget="one2many_tags"/>
      </form></field>
    </record>


Avatar
Discard
Author Best Answer

Actually I didn't notice it but in my code there is no data tag after

<field name="arch" type="xml"> but it's written in the error when I want to install my module !

Avatar
Discard
Best Answer
You can try like this:
<record id="cym_form" model="ir.ui.view">
    <field name="name">CYM Tag</field>
    <field name="model">cym.tag</field>
    <field name="priority">1</field>
    <field name="arch" type="xml">
        <form>
            <sheet>
                <group>
                    <field name="cym_tag"/>
                    <field name="modules" widget="one2many_tags"/>
                </group>
            </sheet>
        </form>
    </field>
</record>
This will solve your problem.
Avatar
Discard
Best Answer

Estuve revisando ,, y yo tenia el mismo error....... lo que trata de decir odoo..... el error es que te falta un dato ........ el dato que te falta es .

<form>

</form>

precisamente donde aparece el """data""" ahi pon eso entonces debera funcionar bien el modulo


Avatar
Discard