Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
8763 มุมมอง

Hi !

I'm creating a module, and I'm stuck on this error :

ValidateError

Une erreur est apparue lors de la validation du/des champ(s) arch: Invalid XML for View Architecture!

Here's the file where's the problem :

<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>   
        <!-- form -->
        <record model="ir.ui.view" id="shipping_res_company_form">
            <field name="model">res.company</field>
            <field name="name">view.inherit.res.company.form</field>
            <field name="view_type">form</field>
            <field name="inherit_id" ref="base.view_company_form"></field>
            <field name="arch" type="xml">
                <field name="image" position="after">
                    <field name="shipping_rule_name"></field>
                </field>
            </field>
        </record>
    </data>
</openerp>

Can someone explain me what I'm doing wrong ? It's very important !
Thanks in advance.

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Try with this:

<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>   
        <!-- form -->
        <record model="ir.ui.view" id="shipping_res_company_form">
            <field name="model">res.company</field>
            <field name="name">view.inherit.res.company.form</field>
            <field name="inherit_id" ref="base.view_company_form"></field>
            <field name="arch" type="xml">
                <xpath expr="//field[@name='image']" position="after">
                    <field name="shipping_rule_name" />
                </xpath>
            </field>
        </record>
    </data>
</openerp>

On OE7 it's not needed:

view_type

Check if you have base on your dependencies.

And it should work

อวตาร
ละทิ้ง
ผู้เขียน

First, thanks for your answer ! I tried the code + add base dependency (I'm still new to module creation so...) but the same error is still there. So now I'm restarting the server, just in case (until now I just tried to update the module when I changed something).

ผู้เขียน

No, changes nothing after restart, can't just logging in.

ผู้เขียน

I've uninstalled the module, but can't reinstall it, still the same error.

Are you creating it with eclipse or pycharm?

ผู้เขียน

With WinSCP, Sublime Text 2 and Putty ^^

ผู้เขียน คำตอบที่ดีที่สุด

I've found the problem, it's so obvious, but I don't know how to fix this. The field "shipping_rule_name" that I tried to add doesn't exist in res.company.form, so the server can't find it.

I will ask on another post.

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
Open form in view mode? แก้ไขแล้ว
4
ธ.ค. 21
31899
1
ธ.ค. 21
7743
1
พ.ย. 24
1685
1
ต.ค. 24
1661
1
ก.ย. 21
9468