title: Odoo Salesperson Orders restrict
body: <p>i want that the salesperson only will see the order he created not every order i want to limit that to the record he created</p>
  <p>'''</p>
  <pre><code>&lt;record model=&quot;ir.module.category&quot; id=&quot;module_category_flexipharmacy&quot;&gt;
          &lt;field name=&quot;name&quot;&gt;Flexipharmacy&lt;/field&gt;
          &lt;field name=&quot;description&quot;&gt;Select if salesperson or owner.&lt;/field&gt;
  
      &lt;/record&gt;
  
      &lt;record id=&quot;group_flexipharmacy_salesperson&quot; model=&quot;res.groups&quot;&gt;
          &lt;field name=&quot;name&quot;&gt;Salesperson&lt;/field&gt;
          &lt;field name=&quot;category_id&quot; ref=&quot;module_category_flexipharmacy&quot;/&gt;
      &lt;/record&gt;
  
      &lt;record model=&quot;ir.rule&quot; id=&quot;salesperson_view&quot;&gt;
          &lt;field name=&quot;name&quot;&gt;Salesperson own order&lt;/field&gt;
          &lt;field name=&quot;model_id&quot; ref=&quot;model_pos_order&quot;/&gt;
          &lt;field name=&quot;domain_force&quot;&gt;[('user_id', '=', 'user.id')]&lt;/field&gt;
          &lt;field name=&quot;groups&quot; eval=&quot;[(4, ref('group_flexipharmacy_salesperson'))]&quot;/&gt;
      &lt;/record&gt;
  </code></pre>
  <p>'''</p>
  <p>now after doing this i am not getting any record in my pos orders all are hidden</p>
  <p>this is the &quot;user_id&quot; which is in the python part:-</p>
  <p><code>user_id = fields.Many2one( comodel_name='res.users', string='Salesperson', help=&quot;Person who uses the cash register. It can be a reliever, a student or an interim employee.&quot;, default=lambda self: self.env.uid, states={'done': [('readonly', True)], 'invoiced': [('readonly', True)]}, ) </code></p>