in ubercart/uc_stock/views/uc_stock.views.inc
we have
function uc_stock_views_data() {
$data['uc_product_stock']['table']['group'] = t('Stock');
$data['uc_product_stock']['table']['join'] = array(
'node' => array(
'left_field' => 'nid',
'field' => 'nid',
),
);
...
If we changed
'left_field' => 'tnid',
the join will happen using the translation nid and will help in exposing the stock level filter of translated nodes/products to views
This is necessary since the {uc_product_stock} table has SKU as the primary key
and translated products can't get their own entry in the stock table
and thus the views can't find the stock levels for translated products
Comments
Comment #1
giorgoskStill the above workaround does not come without problems when it comes to multilanguage sites (or single language sites)
the "tnid" is not set when a node does not have ANY translation
additional steps have to be taken to make sure that a node always has a "tnid"
Comment #2
longwaveThis is a fundamental problem with the current stock table, and #1092322: Primary key on uc_product_stock is wrong has much more detail about what could be done here.