=== modified file 'payment/uc_recurring/uc_recurring.module'
--- payment/uc_recurring/uc_recurring.module	2008-10-16 21:09:57 +0000
+++ payment/uc_recurring/uc_recurring.module	2008-11-03 07:44:20 +0000
@@ -446,15 +446,8 @@
     $fee = uc_recurring_fee_load('product', $feature['pfid']);
   }
 
-  $options = array('' => t('<Any>'), $node->model => $node->model);
-  if (module_exists('uc_attribute')) {
-    $result = db_query("SELECT model FROM {uc_product_adjustments} WHERE nid = %d", $node->nid);
-    while ($row = db_fetch_object($result)) {
-      if (!in_array($row->model, $options)) {
-        $options[$row->model] = $row->model;
-      }
-    }
-  }
+  $options = uc_product_get_models($node);
+  
   $form['model'] = array(
     '#type' => 'select',
     '#title' => t('Applicable Model/SKU'),

=== modified file 'uc_attribute/uc_attribute.module'
--- uc_attribute/uc_attribute.module	2008-10-31 21:21:03 +0000
+++ uc_attribute/uc_attribute.module	2008-11-03 07:46:52 +0000
@@ -319,6 +319,24 @@
  * Ubercart Hooks                                                             *
  ******************************************************************************/
 
+/*
+ * Implementation of hook_uc_produt_models().
+ */
+function uc_attribute_uc_product_models($node) {
+  $models = array();
+  
+  // Get all the SKUs for all the attriibutes.
+  $adjustments = db_query("SELECT model FROM {uc_product_adjustments} WHERE nid = %d", $node->nid);
+  while ($adjustment = db_fetch_object($adjustments)) {
+    if (!in_array($adjustment->model, $models)) {
+      $models[$adjustment->model] = $adjustment->model;
+    }
+  }
+  
+  return $models;
+}
+  
+
 /**
  * Stores the customer's choices in the cart.
  */

=== modified file 'uc_file/uc_file.module'
--- uc_file/uc_file.module	2008-10-15 20:20:43 +0000
+++ uc_file/uc_file.module	2008-11-03 07:44:40 +0000
@@ -349,7 +349,7 @@
     drupal_set_message(t('A file directory needs to be configured in <a href="!url">product feature settings</a> before a file can be selected.', array('!url' => url('admin/store/settings/products/edit/features'))), 'error');
   }
   _file_table_action('insert');
-  $models = (!_get_adjustment_models($node->nid)) ? array(NULL => t('Any'), $node->model => $node->model) : array(NULL => t('Any'), $node->model => $node->model) + _get_adjustment_models($node->nid);
+  $models = uc_product_get_models($node);
 
   if (!empty($feature)) {
     $file_product = db_fetch_object(db_query("SELECT * FROM {uc_file_products} as p LEFT JOIN {uc_files} as f ON p.fid = f.fid WHERE pfid = %d", $feature['pfid']));
@@ -781,29 +781,6 @@
 }
 
 /**
- * Return a list of model adjustments for a given product node
- *
- * @param $nid
- *   The product node id
- * @return:
- *   An associative array containing the models created by different product
- *   attributes or FALSE if none exist.
- */
-function _get_adjustment_models($nid) {
-  $models = array();
-  if (module_exists('uc_attribute')) {
-    $adjustments = db_query("SELECT model FROM {uc_product_adjustments} WHERE nid = %d", $nid);
-    while ($adjustment = db_fetch_object($adjustments)) {
-      if (!in_array($adjustment->model, $models)) {
-        $models[$adjustment->model] = $adjustment->model;
-      }
-    }
-  }
-
-  return (empty($models)) ? FALSE : $models;
-}
-
-/**
  * Return a list of file ids that are in the directory
  *
  * @param $fid

=== modified file 'uc_product/uc_product.module'
--- uc_product/uc_product.module	2008-10-31 15:51:36 +0000
+++ uc_product/uc_product.module	2008-11-03 07:46:20 +0000
@@ -1697,4 +1697,20 @@
     'api' => '2.0',
     'path' => drupal_get_path('module', 'uc_product') .'/views',
   );
-}
\ No newline at end of file
+}
+
+/**
+ * Get all models of a product (node).
+ *
+ * @param $nid
+ *   The node ID of the product.
+ *
+ * Add the generic 'Any' option and the node SKU, then gather any modules' 
+ * models on this node.
+ */
+function uc_product_get_models($node) {
+  $models = array_merge(array(NULL => t('Any'), $node->model => $node->model), module_invoke_all('uc_product_models', $node));
+  
+  asort($models);
+  return $models;
+}

=== modified file 'uc_roles/uc_roles.module'
--- uc_roles/uc_roles.module	2008-10-23 18:43:01 +0000
+++ uc_roles/uc_roles.module	2008-11-03 07:41:20 +0000
@@ -633,17 +633,7 @@
  * Form builder for hook_product_feature.
  */
 function uc_roles_feature_form($form_state, $node, $feature) {
-  $models = array(NULL => t('Any'), $node->model => $node->model);
-
-  // Check if product adjustments exist and add models.
-  if (module_exists('uc_attribute')) {
-    $adjustments = db_query("SELECT model FROM {uc_product_adjustments} WHERE nid = %d", $node->nid);
-    while ($adjustment = db_fetch_object($adjustments)) {
-      if (!in_array($adjustment->model, $models)) {
-        $models[$adjustment->model] = $adjustment->model;
-      }
-    }
-  }
+  $models = uc_product_get_models($node);
 
   // Check if editing or adding to set default values.
   if (!empty($feature)) {

=== modified file 'uc_stock/uc_stock.admin.inc'
--- uc_stock/uc_stock.admin.inc	2008-10-06 18:28:05 +0000
+++ uc_stock/uc_stock.admin.inc	2008-11-03 07:49:44 +0000
@@ -129,7 +129,10 @@
   $form = array();
   $form['stock'] = array('#tree' => TRUE);
 
-  $skus = uc_stock_skus($node->nid);
+  $skus = uc_product_get_models($node);
+  
+  // Remove 'Any'.
+  unset($skus[NULL]);
 
   if (!$skus) {
     drupal_set_message(t('No SKU found.'), 'error');

=== modified file 'uc_stock/uc_stock.module'
--- uc_stock/uc_stock.module	2008-10-28 20:03:02 +0000
+++ uc_stock/uc_stock.module	2008-11-03 07:40:58 +0000
@@ -164,36 +164,6 @@
 }
 
 /**
- * Gets the SKUs associated with a particular product.
- *
- * @param $nid
- *   The node id of the ubercart product
- * @return:
- *   An array containing all the SKUs that are associated with the product or
- *     FALSE if the node ID isn't an Ubercart product.
- */
-function uc_stock_skus($nid) {
-  $node = node_load($nid);
-
-  if (is_null($node->model)) {
-    return FALSE;
-  }
-
-  $skus = array($node->model);
-
-  if (module_exists('uc_attribute')) {
-    $models = db_query("SELECT model FROM {uc_product_adjustments} WHERE nid = %d", $node->nid);
-    while ($model = db_fetch_object($models)) {
-      if (!in_array($model->model, $skus)) {
-        $skus[] = $model->model;
-      }
-    }
-  }
-
-  return $skus;
-}
-
-/**
  * Emails administrator regarding any stock level thresholds hit.
  *
  * @param $order

