On 14/02/11 13:06 -0800, pobsteta wrote:
> Bonjour,
> 
> J'essaie d'étendre le module party.py dans une autre classe par :
> 
> class Party(ModelSQL, ModelView):
>     _name = 'party.party'
> 
>     dispositif = fields.Many2One('dispositif.dispositif', 'dis_num',
> 'Dispositifs')
> 
> Party()
> 
> et la classe party.xml par :
> 
> <?xml version="1.0"?>
> <!-- This file is part of Tryton.  The COPYRIGHT file at the top level
> of
> this repository contains the full copyright notices and license terms.
> -->
> <tryton>
>     <data>
> 
>         <record model="ir.ui.view" id="party_view_form">
>             <field name="model">party.party</field>
>             <field name="inherit" ref="party.party_view_form"/>
>             <field name="arch" type="xml">
>                 <![CDATA[
>                 <data>
>                     <xpath
>                         expr="/form/notebook/
> page[@id=&quot;dispositifs&quot;]"

expr est une expression xpath [1] qui doit pointer sur un tag existant.
Donc dans ce cas ci, je pense que le plus simple est:

    expr="/form/notebook" position="inside"



>                         position="after">
>                         <separator string="Dispositifs" colspan="4"

page au lieu de separator

> id="dispositifs"/>
>                             <label name="dispositif"/>
>                             <field name="dispositif"/>
>                         </page>
>                     </xpath>
>                 </data>
>                 ]]>
>             </field>
>         </record>
> 
>     </data>
> </tryton>
> 

[1] http://www.w3.org/TR/xpath/

-- 
Cédric Krier

B2CK SPRL
Rue de Rotterdam, 4
4000 Liège
Belgium
Tel: +32 472 54 46 59
Email/Jabber: cedric.kr...@b2ck.com
Website: http://www.b2ck.com/

Attachment: pgps5ZogF9Eag.pgp
Description: PGP signature

Répondre à