title: Sugarcrm during Reports generation retrieve data from related fields
body: <p>I am trying to retrieve data from "Opportunities" Reports. </p>
  
  <p>This is my scenario: Opportunity module, field <code>sales_person</code> is a realated field from <code>users</code> module.</p>
  
  <p>In <code>Bids</code> modules I have a <code>relate</code> field with opportunities.</p>
  
  <p>During report generation, I am trying to retrieve the <code>sales_person</code> name in opportunities. But it is not listing in <code>Bids</code> report field_lists.</p>
  
  <p>My dictionary in <code>Bids</code></p>
  
  <pre><code>'opportunity_id_c' =&gt; array(
              'required' =&gt; false,
              'name' =&gt; 'opportunity_id_c',
              'vname' =&gt; 'LBL_OPPORTUNITY_OPPORTUNITY_ID',
              'type' =&gt; 'id',
              'reportable' =&gt; true,
              'calculated' =&gt; false,
              'len' =&gt; 36,
              'size' =&gt; '20',
          ),
          'opportunity' =&gt; array(
              'required' =&gt; false,
              'source' =&gt; 'non-db',
              'name' =&gt; 'opportunity',
              'vname' =&gt; 'LBL_OPPORTUNITY',
              'type' =&gt; 'relate',
              'reportable' =&gt; true,
              'unified_search' =&gt; false,
              'merge_filter' =&gt; 'disabled',
              'len' =&gt; '255',
              'size' =&gt; '20',
              'id_name' =&gt; 'opportunity_id_c',
              'ext2' =&gt; 'Opportunities',
              'module' =&gt; 'Opportunities',
              'rname' =&gt; 'name',
              'quicksearch' =&gt; 'enabled',
              'studio' =&gt; 'visible',
          ),
  </code></pre>
  
  <p>Relationship:</p>
  
  <pre><code>$dictionary['Opportunity']['fields']['opportunities_procurements'] = [
      'name' =&gt; 'opportunities_procurements',
      'type' =&gt; 'link',
      'relationship' =&gt; 'opportunities_procurements',
      'module' =&gt; 'Procurement',
      'bean_name' =&gt; 'Procurement',
      'source' =&gt; 'non-db',
      'vname' =&gt; '',
  ];
  
  $dictionary['Opportunity']['relationships']['opportunities_procurements'] = [
      'lhs_module' =&gt; 'Opportunities',
      'lhs_table' =&gt; 'opportunities',
      'lhs_key' =&gt; 'id',
      'rhs_module' =&gt; 'Procurement',
      'rhs_table' =&gt; 'procurement',
      'rhs_key' =&gt; 'opportunity_id_c',
      'relationship_type' =&gt; 'one-to-many',
  ];
  </code></pre>
  
  <p>This is what I tried: I tried to create a similar field <code>opportunity</code> in bids module named as <code>opportunity_sales_user</code>and in dictionary instead of <code>'rname' =&gt; 'name',</code> I use <code>'rname' =&gt; 'sales_person',</code> but I didn't get the data as the <code>sales_person</code> is related record. </p>
  
  <p>I couldn't retrieve the vales in <code>Reports</code>.</p>
  
  <p>How can I create a full relationship so I can get the <code>sales_person</code> value in <code>Bids</code> reports generation?</p>