openerp-community team mailing list archive
-
openerp-community team
-
Mailing list archive
-
Message #00256
Re: Problem with views
-
To:
OpenERP Community <openerp-community@xxxxxxxxxxxxxxxxxxx>
-
From:
Olivier Dony <odo@xxxxxxxxxxx>
-
Date:
Mon, 21 Mar 2011 14:37:30 +0100
-
In-reply-to:
<1300713128.13844.2.camel@dev-station>
-
Organization:
OpenERP s.a.
-
User-agent:
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101208 Thunderbird/3.1.7
Le 21/03/11 14:12, Thibaut DIRLIK a écrit :
Thanks for your answer. So, how could I do to do what I want? I have to
copy/paste the entire sale order view and create a new one ? This
doesn't seem to be a good way to obtain what I want.
Copy/pasting the whole view is probably the worst solution indeed.
Perhaps you could work with groups, adding your commission-related
fields in the view in all cases, but with a groups="..." attributes
that shows them only to users would belong to the group with that XML
ID? This is commonly done with the "Usability/Extended view" group.
Another option could be to use context values in your view, in the
visibility or attrs values. For example you could perhaps use:
invisible="context.get('commission_enabled')"
and then put a specific context in the action that launches your
specific view.
I'm not 100% sure it will work for all your needs, but a combination of
this and groups-based visibility may allow you to come close to what you
want.
On a side note, view copy-by-value works as you expect when using a
different "model", e.g. for use with "_inherits", or "_inherit" with
a different "_name". But that won't help you here, presumably.
PS: Not sure you answered directly to me, or to the ML.
Indeed I forgot to copy the list in my initial reply, thanks for
reminding me :-)
Follow ups
References