← Back to team overview

openerp-community team mailing list archive

Re: Problem with views

 

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