cancel
Showing results for 
Search instead for 
Did you mean: 

Stock level relation with products

Former Member
0 Kudos

can some one quantify the use of stockLevel collection [Products2StockLevelRel] attribute. As the stock service getAvailability or any method in that case still fetches the data from stocklevel entries. Why should we manage an additional overhead of managing the relation with product.

Accepted Solutions (0)

Answers (1)

Answers (1)

andyfletcher
Active Contributor
0 Kudos

What version of Hybris are you using? I don't have this relation. I do have a StockLevelProductRelation but that is obsolete and should not be used.

Stock levels are related to products by their productCode attribute. The relationship between product and stock is global across all catalogue versions so shouldn't be tied to a specific one. There is no such thing as 'staged' stock.

tino_kissig
Active Participant
0 Kudos

Someone should tell the guys building the B2B Accelerator that StockLevelProductRelation should not be used anymore since the order form uses it still. Other parts of the B2B Accelerator are already using the "new" approach...

andyfletcher
Active Contributor
0 Kudos

Huh, well that's fairly surprising. Maybe they have some requirements that I'm not aware of but that's not how the DefaultStockLevelDao looks up stock levels.

tino_kissig
Active Participant
0 Kudos

The problem is that ProductVariantMatrixPopulator#createNodeLeafSpecific still calls ProductModel#getStockLevels rather than using CommerceStockService to get the stock information.

andyfletcher
Active Contributor
0 Kudos

Surely that just doesn't work? I guess that's your point!

As an aside, how many levels of nested comment replies can you get in experts before it breaks? The comments are getting quite narrow now.

tino_kissig
Active Participant
0 Kudos

I think it is quite frustrating to find out that the shipped code doesn't work as propagated by hybris out of the box . Took me a while to figure out what was wrong...