On 07/09/10 15:15 +0800, Seyed Mohammad Motahar wrote:
> Thank you Cedric for your comments.
> I have just tried but it doesn't work. Maybe because i missed something
> else.
> At least i know i am on the right direction based on your comment.
> I just want to mention by some details as i thought maybe i wasn't  able to
> explain it correctly.
> 
> class model1()
> _name='company.model1'
> *multiprice *= fields.Boolean("Multi Price allowed?
> mod2 = fields.one2many(model2 ...etc...)
> 
> class model2()
> _name='company.model2'
> mod1ref = fields.many2one(model1 , ...etc...)
> mod3 = fields.one2many(model3 .... etc ...)
> 
> 
> class model3()
> mod2ref = fields.many2one(model1, ...etc,....)
> FF = fields.Boolean("FF" , states=STATES)
> 
> STATES = {
>            'invisible' : Bool(Eval('_parent_model1.*multiprice*')),
>            }

It mus be:

    Bool(Eval('_parent_model2._parent_model1.multiprice'))

> 
> Actually i want to make this field invisible based on the value from parent
> of his parent.
> I tried the sample code it seems that it always return "True" value.
> As i tested before, Even if i  put some loblob instead of multi price. It
> also returns True.

If Eval doesn't find the field then it uses the default one. This allow to
have always a result (without exception).

> Just to ask whether this is because of some small tips, For example i'm
> writing classless in different files (.py).
> was it the cause of such problems ?

No.


-- 
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: pgp27D6UjcKqd.pgp
Description: PGP signature

Reply via email to