On 18 Feb 09:19, appu rongala wrote:
> Hi All,
> 
> I have 2 models called Member , Address
> 
> class Member(ModelView, ModelSql):
>         name = fields.char("Name")
>         age = fields.Integet("Age")
>         addr = fields.one2many("Address", member)
> 
> class Address(ModelView, ModelSql):
>        member = fields.Meny2One("Member", Name1)
>        addr = fields.Text("Address")
> 
> so basically the relation is Member can have one or more addresses.
> I want to read member details and added addresses and insert into another 
> model called Member1 and Address1.
> I am tryting to fetch data in create method but not able to get id of 
> record. because it is not created yet.
> 
> so My question what is the place to fetch complete added details of the 
> record?
> or where should i trigger this.

As you have a one2many field, why don't you use its API to create target
relations?
http://doc.tryton.org/3.0/trytond/doc/ref/models/fields.html?highlight=one2many#trytond.model.fields.One2Many

-- 
Cédric Krier - B2CK SPRL
Email/Jabber: [email protected]
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

Attachment: pgp2fjoZQvvcj.pgp
Description: PGP signature

Reply via email to