Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
5770 Lượt xem

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.

Ảnh đại diện
Huỷ bỏ

If you are debugging, please post the entire error.

Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

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>
Ảnh đại diện
Huỷ bỏ