On 06 Jan 07:20, Mariano Ramon wrote:
> class CustomParty(ModelSQL, ModelView):
>     'Party'
>     __name__ = 'party.party'
> 
>     @classmethod
>     def create(cls, vlist):
>         records = super(CustomParty, cls).create(vlist)
>         target = CustomPatient()
>         target.name = records[0]
>         target.save()

You must return records

> but this gives me
> 
> assert self.name is not None
> AssertionError

It looks like your CustomPatient is not registered in the Pool

> printing records[0]
> gives me <class 'trytond.pool.party.party'>

Yes that is the first record created and you can not assign a instance
to a Char field (which I guess name is).

> the question would be how do I get the instances of the party that was just 
> created? I have the impression that I'm missing some basic python stuff 
> here, even some basic programming concept maybe.. sorry about that.


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

Reply via email to