Variant Overrides - Hub can override stock level and price on a variant

Why have variant overrides?

‘Variant overrides’ enable a stock level and price of a variant to be overridden for a specific Hub. This means that the Producer and Product information is kept intact and it is the same Product / Variant, but:

  • a Hub can retain the P/V in stock, and draw from the amount that they have (not the amount that the Producer has)
  • a Hub can override the price set by the Producer (for example if they want to do a special on it)
  • [CHECK] a Producer can set a stock availability or price that is specific to one Hub

Variant overrides are set using the Overrides tab, under Products

When can a User override variant values?

[CHECK] As an enterprise user, I can override variants when I can manage products. I can do this when I manage any enterprise that is not a profile.

When I do so, I am limited in the hubs that I can create overrides for. I can only create overrides for the hubs that I can add to an order cycle.

I am also limited in the products that I can create overrides for. This limitation depends on the producer of the product. I can create overrides for products of producers where I manage the producer or I have been granted “create variant override” permission from the producer.

Who can edit a tagged variant?

Variant override permissions are managed via E2E Links and Permissions, so they are accessible by any Manager of permitted Enterprises.

Testing Notes

OFN Producer 5 does not allow any enterprise to create variant overrides

OFN Independent Hub does not allow any User to create variant overrides

As User hello@openfood

  • I manage OFN Producer 5.
  • I do not manage OFN Independent Hub

As the manager of OFN Producer 5, I have created an Override for OFN Independent Hub. This override appears in all of OFN Independent Hub’s order cycles

I think these specs are out of date, @RohanM and I need to go through them and clarify intended and existing behaviour

check following specs
Think it may be reading off P-OC rather than P-VO . . which means it’s bringing up some variants it shouldn’t e.g. if I am manager of Producer 2 and Hub 1, and P2 has given H1 P-OC, VO:

I get drop-down options for Hubs 1, 2, 3 [Correct, I am manager of H1, and P2 has given P-VO to all 3 of these]
and Independent [incorrect? I am not manager, Independent has not given P-VO to Hub1; and P2 has not given P-VO to Independent], but Independent HAS given P-OC to Hub1
when I select Hub 2 [I am not manager, but P2 has given P-VO]
I see P1, P2, P3 . .
Hub2 has given Hub1 P-OC, so it may be checking my user H1, and then using P-OC to determine the list I see?