Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
2 Respostas
5790 Visualizações

I've been stuck in this error since 4 hours ago. I searched everywhere, copy the right solutions, but nothing changes.

class jobsopen(osv.osv):
    _name = 'jobsopen.jobsopen'
    _columns = {
                    'name':fields.char('Name', size=20, required = True),
               }    
<?xml version="1.0"?>
<openerp>
    <data>
        <record id="jobsopen_jobsopen_tree_view" model="ir.ui.view">
        <field name="name">jobsopen.jobsopen.tree</field>
        <field name="model">jobsopen.jobsopen</field>
        <field name="arch" type="xml">
            <tree string="Jobs">
                <field name="name"/>
            </tree>
        </field>
    </record>
    </data>
</openerp>

I already tried to put:

 <field name="type">tree</field>

But it continues not to work.

Avatar
Cancelar

If you are debugging, please post the entire error.

Melhor resposta

for one you do not have an ending for you class. Did you create all the other required files, __init__.py and openerp.py and in the openerp.py, did you declare the to update the view of module? Restart your server and reload the module in the web client. Restarting help update the python while reloading or upgrading the module in the web client will ensure your xml view is updated

Avatar
Cancelar
Autor Melhor resposta

Hey guys,

Primarily, thanks for the fast answer. I just solved the issue. It seems that I wasn't put the right terms in the XML. Said this, my tree now look like this, and it's working perfectly.

<record model="ir.ui.view" id="jobsopen_tree">
        <field name="name">jobsopen.tree</field>
        <field name="model">jobsopen.jobsopen</field>
        <field name="type">tree</field>
        <field name="arch" type="xml">
            <tree string="jobsopen tree">
                <field name="name"/>
            </tree>
        </field>
    </record>
Avatar
Cancelar