 modules/customer/commerce_customer.module          |  9 ++++++++
 .../views/commerce_product_reference.views.inc     | 27 +++++++++++++++++++---
 2 files changed, 33 insertions(+), 3 deletions(-)

diff --git a/modules/customer/commerce_customer.module b/modules/customer/commerce_customer.module
index 2817ee5..e380898 100644
--- a/modules/customer/commerce_customer.module
+++ b/modules/customer/commerce_customer.module
@@ -423,6 +423,15 @@ function commerce_customer_commerce_checkout_pane_info() {
 function commerce_customer_field_views_data($field) {
   $data = field_views_field_default_views_data($field);
 
+  // Add a join to commerce_customer_profile so that it can be used by the inverse relationship.
+  $data[_field_sql_storage_tablename($field)]['table']['join']['commerce_customer_profile'] = array(
+    'left_field' => 'profile_id',
+    'field' => $field['field_name'] . '_profile_id',
+    'extra' => array(
+      array('field' => 'deleted', 'value' => 0, 'numeric' => TRUE),
+    ),
+  );
+
   // Build an array of bundles the customer profile reference field appears on.
   $bundles = array();
 
diff --git a/modules/product_reference/includes/views/commerce_product_reference.views.inc b/modules/product_reference/includes/views/commerce_product_reference.views.inc
index 07d5c92..36f0080 100644
--- a/modules/product_reference/includes/views/commerce_product_reference.views.inc
+++ b/modules/product_reference/includes/views/commerce_product_reference.views.inc
@@ -89,9 +89,6 @@ function commerce_product_reference_views_data_alter(&$data) {
     }
 
     foreach ($field['bundles'] as $entity_type => $bundles) {
-      if ($entity_type == 'commerce_line_item') {
-        continue;
-      }
 
       $entity_info = entity_get_info($entity_type);
       $data['commerce_product'][$field['field_name']]['relationship'] = array(
@@ -107,4 +104,28 @@ function commerce_product_reference_views_data_alter(&$data) {
       );
     }
   }
+
+  // Adds inverse relationships between the product and entity types referencing
+  // it (for example, nodes).
+  foreach (field_info_fields() as $field_name => $field) {
+    if ($field['type'] !== 'commerce_customer_profile_reference') {
+      continue;
+    }
+
+    foreach ($field['bundles'] as $entity_type => $bundles) {
+
+      $entity_info = entity_get_info($entity_type);
+      $data['commerce_customer_profile'][$field['field_name']]['relationship'] = array(
+        'handler' => 'views_handler_relationship',
+        'base' => $entity_info['base table'],
+        'base field' => $entity_info['entity keys']['id'],
+        'relationship table' => _field_sql_storage_tablename($field),
+        'relationship field' => 'entity_id',
+
+        'label' => t('!entity_type referencing customer profiles from !field_name', array('!entity_type' => $entity_info['label'], '!field_name' => $field['field_name'])),
+        'title' => t('!entity_type referencing customer profiles from !field_name', array('!entity_type' => $entity_info['label'],  '!field_name' => $field['field_name'])),
+        'help' => t('Relate a customer profiles to the !entity_type referencing it.', array('!entity_type' => strtolower($entity_info['label']))),
+      );
+    }
+  }
 }
