On 07/09/10 13:46 +0200, Paul J Stevens wrote:
> On 09/06/2010 11:20 PM, "Cédric Krier" <[email protected]>" wrote:
> > On 06/09/10 21:45 +0200, Paul J Stevens wrote:
> >>
> >> Hi all,
> >>
> >> I'm building a customization module to prime the database with parties,
> >> addresses, chart-of-accounts, etc.
> >>
> >> Since my module relies on account I need to resolve the account_payable
> >> and account_receivable requirements. But where can I find documentation
> >> about setting up the many2one references in xml to do this? Some basic
> >> examples would be great - or do I need to look at openerp demo content
> >> for hints?
> > 
> > I'm not sure to understand. But I think you are looking for the ref
> > attribute.
> > http://doc.tryton.org/1.6/trytond/doc/topics/modules/index.html#xml-files
> > 
> 
> Ok, let me rephrase then: I'm aware of the ref attribute, but how does
> it work? What if I don't know the xml id of the references item?
> 
> For instance reference by name doesn't work:
> 
> <record model="party.party" id="party_0">
>   <field name="name">NFG Net Facilities Group BV</field>
>   <field name="code">NFG</field>
>   <field name="vat_number">811863761B01</field>
>   <field name="vat_country">NL</field>
>   <field name="active" eval="True"/>
>   <field name="account_payable" ref="Crediteuren"/>
>   <field name="account_receivable" ref="Debiteuren"/>
> </record>
> 
> So my basic question is/was: where if anywhere is this documented, or
> should I 'use the source'?

There is the search attribute (just one line above).

But if you don't know the id, it means that your are linking to a data that
has not been created by XML.

So it seems that you are using XML file to import data which is a practice
that I don't recommend because:

- XML data are readonly by default
- XML data are recreated if missing
- XML data can be override on update

-- 
Cédric Krier

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

Attachment: pgpQyREuKhYHN.pgp
Description: PGP signature

Reply via email to