On Sábado 25 Febrero 2012 06:52:02 Cédric Krier escribió:
> 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.data1
>
> No, 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.
It would be very nice if one can access form data at any time. ( i think it is
esential for a
development framework )
If you remove context in fields, how coud be default_ implemented depending
on parent data with
domains ???
thnx.
--
Felipe Alvarez Harnecker
[email protected] - 9.874.60.17
--
[email protected] mailing list