title: Odoo 13: User ID (uid) passed into domain for Window Action in dashboard view throws JS Error, works fine outside of dashboard view
body: <p>I am trying to show a filtered tree view of records that I have in a dashboard view. I already have an action where it works fine, this is the one</p>
  <pre><code># Basic action for vlabel.product
  &lt;record id=&quot;action_product&quot; model=&quot;ir.actoins.act_window&quot;&gt;
      &lt;field name=&quot;name&quot;&gt;Products&lt;/field&gt;
      &lt;field name=&quot;res_model&quot;&gt;vlabel.product&lt;/field&gt;
      &lt;field name=&quot;view_mode&quot;&gt;tree,form&lt;/field&gt;
      &lt;field name=&quot;domain&quot;&gt;[('related_company.vlabel_person', '=', uid)]
  &lt;/record&gt;
  </code></pre>
  <p>This works perfect for this view, only showing product records where the vlabel_person (res.user) of the related_company (res.partner) is the current logged in user (uid)</p>
  <pre><code># Tree view for vlabel.product
  &lt;record id=&quot;product_tree&quot; model=&quot;ir.ui.view&quot;&gt;
      &lt;field name=&quot;name&quot;&gt;Products&lt;/field&gt;
      &lt;field name=&quot;model&quot;&gt;vlabel.product&lt;/field&gt;
      &lt;field name=&quot;arch&quot; type=&quot;xml&quot;&gt;
          &lt;tree string=&quot;Products&quot;&gt;
              &lt;field name=&quot;name&quot;/&gt;
              &lt;field name=&quot;related_company&quot;/&gt;
          &lt;/tree&gt;
      &lt;/field&gt;
  &lt;/record&gt;
  </code></pre>
  <p>Now I created a dashboard view that also works fine without the domain, but with the domain is throws this Error.</p>
  <pre><code>Traceback:
  PY_ensurepy@http://adriann-virtualbox:8069/web/content/270-7a3e6e6/web.assets_backend.js:90:65
  py.evaluate@http://adriann-virtualbox:8069/web/content/270-7a3e6e6/web.assets_backend.js:207:8
  py.evaluate@http://adriann-virtualbox:8069/web/content/270-7a3e6e6/web.assets_backend.js:213:111
  py.evaluate@http://adriann-virtualbox:8069/web/content/270-7a3e6e6/web.assets_backend.js:215:99
  py.eval@http://adriann-virtualbox:8069/web/content/270-7a3e6e6/web.assets_backend.js:220:284
  eval_domains/&lt;@http://adriann-virtualbox:8069/web/content/270-7a3e6e6/web.assets_backend.js:362:136
  _.forEach@http://adriann-virtualbox:8069/web/content/265-b072167/web.assets_common.js:108:566
  _.mixin/&lt;/_.prototype[name]@http://adriann-virtualbox:8069/web/content/265-b072167/web.assets_common.js:165:526
  eval_domains@http://adriann-virtualbox:8069/web/content/270-7a3e6e6/web.assets_backend.js:361:265
  pyeval@http://adriann-virtualbox:8069/web/content/270-7a3e6e6/web.assets_backend.js:377:24
  _createController/&lt;@http://adriann-virtualbox:8069/web/content/270-7a3e6e6/web.assets_backend.js:2690:182
  </code></pre>
  <p>I tried the domain for the dashboard action with different fields and it worked fine there too. It basically worked with all fields, but never with checking against the uid, which leads me to believe that somehow in this action that I created for the dashboard view, the domain doesn't know the uid, which I frankly don't get. I googled around and found no mention of a specific use case of the uid that does not apply to an action called in a dashboard.</p>
  <pre><code># New Action for dashboard view (this one throws the error)
  &lt;record id=&quot;action_product_wip&quot; model=&quot;ir.actions.act_window&quot;&gt;
      &lt;field name=&quot;name&quot;&gt;Products WIP&lt;/field&gt;
      &lt;field name=&quot;res_model&quot;&gt;vlabel.product&lt;/field&gt;
      &lt;field name=&quot;domain&quot;&gt;[('related_company.vlabel_person', '=', uid)]&lt;/field&gt;
      &lt;field name=&quot;view_mode&quot;&gt;tree,form&lt;/field&gt;
  &lt;/record&gt;
  
  # Dashboard view
  &lt;record id=&quot;dashboard_form_view&quot; model=&quot;ir.ui.view&quot;&gt;
      &lt;field name=&quot;name&quot;&gt;Dashboard Form&lt;/field&gt;
      &lt;field name=&quot;model&quot;&gt;board.board&lt;/field&gt;
      &lt;field name=&quot;type&quot;&gt;form&lt;/field&gt;
      &lt;field name=&quot;arch&quot; type=&quot;xml&quot;&gt;
          &lt;form string=&quot;Dashboard&quot;&gt;
              &lt;board style=&quot;1-1&quot;&gt;
                  &lt;column&gt;
                      &lt;action
                          string=&quot;Products WIP&quot;
                          name=&quot;%(vlabel.action_product_wip)d&quot;/&gt;
                  &lt;/column&gt;
              &lt;/board&gt;
          &lt;/form&gt;
      &lt;/field&gt;
  &lt;/record&gt;
  
  &lt;record id=&quot;vlabel_dashboard&quot; model=&quot;ir.actions.act_window&quot;&gt;
      &lt;field name=&quot;name&quot;&gt;Dashboard&lt;/field&gt;
      &lt;field name=&quot;res_model&quot;&gt;board.board&lt;/field&gt;
      &lt;field name=&quot;view_mode&quot;&gt;form&lt;/field&gt;
      &lt;field name=&quot;usage&quot;&gt;menu&lt;/field&gt;
      &lt;field name=&quot;view_id&quot; ref=&quot;dashboard_form_view&quot;/&gt;
  &lt;/record&gt;
  
  &lt;menuitem name=&quot;Dashboard&quot; id=&quot;menu_dashboard&quot;
       parent=&quot;vlabel_menu_root&quot; action=&quot;vlabel_dashboard&quot;
       sequence=&quot;1&quot;/&gt;
  </code></pre>
  <p>Any help or explanation why checking against the uid works perfect in the action_product but not in action_product_wip is much appreciated.</p>
  <p>Also, this is my first post here, whatever that means you can decide for yourself.</p>
  <p>Cheers,
  Adrian</p>