It is currently Mon May 21, 2012 6:14 pm

All times are UTC + 2 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: [SOLVED]Inherit a search view to add a filter
PostPosted: Thu Apr 14, 2011 6:43 pm 
Offline

Joined: Fri May 28, 2010 10:33 am
Posts: 409
Hi, I need some help to modify a search view on the partner.

I want to add a new filter (toggle button) with a new condition (domain)

The code of view is:
Code:
<record id="view_partners_search_administradores" model="ir.ui.view">
   <field name="name">res.partner.mantenimientos.search.inherit</field>
   <field name="model">res.partner</field>
        <field name="type">search</field>      
   <field name="inherit_id" ref="base.view_res_partner_filter"/>
        <field name="arch" type="xml">
      <xpath expr="/search/field[@name='supplier']" position="after">
            <filter string="Administrador" name="administrador" icon="terp-personal" domain="[('administrador','=','1')]" />
      </xpath>
        </field>
</record>


I create a .py with inherit res.partner to add the field 'administrador'


But the error is
Code:
AttributeError: View definition error for inherited view 'mantenimientos.view_partners_search_administradores' on 'res.partner' model: Element '<xpath expr="/search/field[@name='supplier']">' not found in parent view 'base.view_res_partner_filter'


Any info about this (how to inherit a search view to add a filter)

Thanks

Juanjo A

_________________
Formación online OpenERP - Programación módulos - Apoyo instalación
http://www.malagatic.com @malagatic


Last edited by JuanjoA on Fri Apr 15, 2011 9:34 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Inherit a search view to add a filter
PostPosted: Fri Apr 15, 2011 9:33 am 
Offline

Joined: Fri May 28, 2010 10:33 am
Posts: 409
Ok, solved, the problem is the xpath expression:

Code:
<xpath expr="//filter[@name='supplier']" position="after">
   <filter string="Administrador" name="administrador" icon="terp-personal" domain="[('administrador','=','1')]" />
</xpath>


Thx
Juanjo A

_________________
Formación online OpenERP - Programación módulos - Apoyo instalación
http://www.malagatic.com @malagatic


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 2 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:

Protected by Anti-Spam ACP