← Back to team overview

credativ team mailing list archive

[Bug 920033] Re: [6.1[RC]]: Cannot use uid along with attrs

 

Hi,

The "uid" dynamic value is not a valid field to be evaluated client-side. This was working previously  because the clients (GTK/Web) happened to have a "uid" value available in the evaluation context, but that is not guaranteed to be the case, as far as I know.
What you are trying to do seems a little bit of a corner case (none of the standard addons do it), so I'm not sure it would be worth adding a global "uid" value to client-side evaluation context.

What we often want to do is to selectively hide fields based on user groups or document states. These 2 cases are covered by the API with the ``states`` and ``groups`` attributes.
Here you want the behavior to differ when the user is viewing one of her "own documents". A simple workaround to accomplish this would be to add a function field to that document, and have it always return the current user ID. If you named the field "uid" you could probably keep your existing `attrs`.

As for adding "uid" to the default client-side (web) evaluation context,
and making it a permanent API feature, it should be discussed with the
web team, so I'm reassigning it to them.

** Summary changed:

- [6.1[RC]]: Cannot use uid along with attrs
+ 6.1RC1: 'uid' not available in attrs evaluation context

** Project changed: openobject-server => openerp-web

** Changed in: openerp-web
       Status: New => Triaged

** Changed in: openerp-web
     Assignee: (unassigned) => OpenERP R&D Web Team (openerp-dev-web)

** Changed in: openerp-web
    Milestone: None => 6.1

-- 
You received this bug notification because you are a member of OpenERP
Framework Experts, which is subscribed to OpenERP Server.
https://bugs.launchpad.net/bugs/920033

Title:
  6.1RC1: 'uid' not available in attrs evaluation context

Status in OpenERP Web:
  Triaged

Bug description:
  When I try to compare the logged in user with the user_id stored on
  the database to run time display a field or button using
  attrs="{'invisible':[('user_id','=',uid)]}", it does not work.

  Was working in previous versions. Please suggest a fix.

To manage notifications about this bug go to:
https://bugs.launchpad.net/openerp-web/+bug/920033/+subscriptions


References