Por experiencia propia, pude ver que la lista de inventario contempla solamente artículos que hayan tenido algún ingreso en algún almacén, lo cual es un gran problema para hacer una carga de stock inicial. Por ahora, el workaround que tenemos implementado es ejecutar el siguiente script SQL de manera periódica (reemplazar los IDs según corresponda).
Code:
insert into m_storage
select
x.*
from
(
select
p.m_product_id,
l.m_locator_id,
p.ad_client_id,
l.ad_org_id,
‘Y’ as isactive,
now() as created,
0 as createdby,
now() as updated,
1010717 as updatedby,
0 as qtyonhand,
0 as qtyreserved,
0 as qtyordered,
now() as datelastinventory,
0 as m_attributes
from m_product as p
cross join m_locator l
where
p.ad_client_id = 1010016
and l.ad_client_id = 1010016
and p.producttype = ‘I’
) as x
left join m_storage s on
x.m_product_id = s.m_product_id
and x.m_locator_id = s.m_locator_id
and x.ad_client_id = s.ad_client_id
and x.ad_org_id = s.ad_org_id
where s.m_product_id is null
Saludos,
Saulo