On 24/02/12 19:29 -0300, Felipe Alvarez Harnecker wrote:
> Hi,
>
> supose you have these models:
>
> Master(...):
>
> lines = fields....
> data1 = ....
>
> Detail(...)
>
> master = fields....
> data2 = ...
>
>
> and you want to set default of data2 depending on data1, i managed to do it
> using context in lines,
> i.e.
>
> lines = fields..... context={'data1':Eval('data1')}
>
> bur i think it is unelegant and very redundant way to do it.
>
> is there a way like this to do it?
>
> def default_data2(self):
>
> parent_data = self.parent.data1No, it is not possible because the parent may not be saved in the database. By the way, the plan is to remove context on fields since we have the domain inversion. -- 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/
pgp3qBuvNuKTC.pgp
Description: PGP signature
