コンテンツへスキップ
メニュー
この質問にフラグが付けられました
3 返信
6048 ビュー

This is usually how i declare a view in openerp 6.1 and so far has worked correctly...

But i started a project with openerp 7.0 and this view appears as undefined in the debug mode and can't seem to see why.

<record model="ir.ui.view" id="stock_location_department_view">
    <field name="name">stock.location.form</field>
    <field name="model">stock.location</field>
    <field name="inherit" ref="stock.view_location_form" />
    <field name="type">form</field>
    <field name="arch" type="xml">
        <field name="company_id" position="after">
            <field name="department_id"/>
        </field>
    </field>
</record>
アバター
破棄

what is the error you are getting ? can you please log it here

著作者

That's the weird thing, it doesn't give me an error, it just doesn't show the field department_id. The view appears in the debug, but where it should say Form or Tree, it justs says undefined.

著作者

Actually, now that i look better at the code... shouldn't it be <field name="inherit_id" ???? I think that may be it.

最善の回答

Hi,

use xpath expr :

 <xpath expr="//field[@name='company_id']" position="after" >
           <field name="department_id"/>
  </xpath>
アバター
破棄
著作者

Somebody commented me that xpath expressions are outdated. Is this true? Also, what is the logic of a xpath expr, i don

著作者

Thanks. :D

最善の回答

Hi

try this without form field.

                   <record model="ir.ui.view" id="stock_location_department_view">
                  <field name="name">stock.location.form</field>
                   <field name="model">stock.location</field>
                 <field name="inherit_id" ref="stock.view_location_form" />
                 <field name="arch" type="xml">
                 <field name="company_id" position="after">
                     <field name="department_id"/>
                     </field>
               </field>

Thanks
Sandeep

アバター
破棄
最善の回答

Try this cde: It is inherit_id

<record model="ir.ui.view" id="stock_location_department_view">
<field name="name">stock.location.form</field>
<field name="model">stock.location</field>
<field name="inherit_id" ref="stock.view_location_form" />
<field name="type">form</field>
<field name="arch" type="xml">
    <field name="company_id" position="after">
        <field name="department_id"/>
    </field>
</field>

</record>

アバター
破棄
著作者

Yes, this was my mistake. Thank you very much.

you are welcome

関連投稿 返信 ビュー 活動
6
12月 23
30731
1
3月 15
5444
2
9月 23
8515
1
9月 23
2719
2
3月 22
6604