Odoo Help

1

How to declare views in openerp 7.0?

By
Carlos Llamacho
on 6/18/13, 3:01 PM 2,837 views

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

Pravitha
on 6/19/13, 2:07 AM

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.

Carlos Llamacho
on 6/19/13, 2:10 AM

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

Carlos Llamacho
on 6/19/13, 2:12 AM
1

Borni DHIFI

--Borni DHIFI--
5257
| 6 8 9
Tunis, Tunisia
--Borni DHIFI--

Techno Functional Consultant Odoo(OpenERP) 

http://www.linkedin.com/in/borni

Skype : dhifi.borni

Borni DHIFI
On 6/18/13, 7:54 PM

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

Carlos Llamacho
on 6/19/13, 12:16 AM

Thanks. :D

Carlos Llamacho
on 6/25/13, 4:48 PM
2

ClueLogics Technologies Pvt. Ltd.

--ClueLogics Technologies Pvt. Ltd.--
6143
| 6 5 8
Delhi NCR, India
--ClueLogics Technologies Pvt. Ltd.--

 ClueLogics Technologies Pvt Ltd is a Software product and services provider. We are positioned to deliver robust, rapid and reliable Information Technology solutions that work. What we succeed upon is Technology and Technical Expertise. The industry review of ClueLogics has been commendable for the past years as most of its business comes from repeat orders by highly satisfied clients.

ClueLogics Technologies Pvt. Ltd.
On 6/19/13, 3:45 AM

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

0
Pravitha
On 6/19/13, 3:30 AM

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.

Carlos Llamacho
on 6/21/13, 11:40 AM

you are welcome

Pravitha
on 6/24/13, 1:49 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)

Stats

Asked: 6/18/13, 3:01 PM
Seen: 2837 times
Last updated: 3/16/15, 8:10 AM