title: how to use functional field in record rule?
body: <p>I am trying to achieve that all the users that are Hr managers should be allowed to see the records.
  I have created a Functional Field:</p>
  
  <pre><code>def list_HRM(self, cr, uid, ids, field_name, arg, context):
           attribute = {}
          hr_managers = self.pool.get('hr.employee').search(cr, uid, ['&amp;', ('department_id.name', '=', 'Human Resources'), ('manager', '=', True)], context=context)
          hr_managers_uid = []
          for record in hr_managers:
              hr_managers_uid.append(self.pool.get('hr.employee').browse(cr, uid, record, context=context).user_id.id)
          record = self.browse(cr, uid, ids)[0]
          attribute[record.id] = str(uid in hr_managers_uid or uid==1)
          return attribute
  
      _columns={
      'hr_managers_func' : fields.function(list_HRM, type='char', method=True, string='List of HR Managers'),
      'always_true':fields.boolean()
       }
     _defaults={
        'always_true':True
        }
  </code></pre>
  
  <p>In .xml file:</p>
  
  <pre><code>&lt;field name="always_true" invisible="1"/&gt;
  &lt;field name="hr_managers_func" invisible="1"/&gt;
  </code></pre>
  
  <p>In Record Rule:</p>
  
  <pre><code>['&amp;','|',('state','=','hod_depart'),('state','=','hr_review'),('always_true','=',eval(hr_managers_func))]
  </code></pre>
  
  <p>I used field 'always_true' because of the record rule condition format i.e.
  [('field_name','operator',values)].
  I thought that rule will evaluate the functional field using eval 
  but unfortunately eval is not working on the record rule ,
  I am getting this error:</p>
  
  <pre><code>NameError: name 'eval' is not defined
  </code></pre>
  
  <p>I could not think of more than this.
  I saw few forum somewhat similar to my problem, they were using the related field to avoid the functional field in the record, but here I have to check whether the current user belong to hr managers or not .
  I have tried explaining this in the best possible way, Looking forward for some reply.</p>