openfoodfoundation / openfoodnetwork

Connect suppliers, distributors and consumers to trade local produce.
https://www.openfoodnetwork.org
GNU Affero General Public License v3.0
1.12k stars 723 forks source link

[Inventory] Setting variants as hidden always hides them in outgoing exchange of OC, regardless of enterprise settings #11851

Open filipefurtad0 opened 11 months ago

filipefurtad0 commented 11 months ago

Description

This looks like a regression from #11501.

An enterprise has the New products can be put into my shopfront (recommended) setting enabled, but inventory items are still not being displayed for selection; instead, the message introduced in #11501 is displayed in the outgoing exchange of the order cycle.

This is preventing coordinators from adding variants to order cycles, requiring for suppliers to additionally grant permissions to distributors: only permissions between supplier - coordinator AND distributor - coordinator should be necessary. Reported here.

Expected Behavior

As the order cycle coordinator, having the option the enterprise setting New products can be put into my shopfront (recommended) does not allow hidden inventory items to be added in the outgoing exchange of the order cycle.

Actual Behaviour

As per user guide, it is only when:

Steps to Reproduce

The easiest way to reproduce the bug is with one enterprise, acting as coordinator, supplier and distributor of an order cycle:

  1. Add a variant to the inventory.
  2. Set it as hidden.
  3. On the dashboard, enable the preference New products can be put into my shopfront (recommended)
  4. Create an order cycle.
  5. Add the variant to the incoming exchange
  6. Try to add it to the outgoing exchange -> see the warning No variant available for this product (hidden via inventory settings).

Animated Gif/Screenshot

image

Workaround

On the inventory, toggle the column hidden; click Add. The variant should be to be selected again, on the outgoing exchange of the order cycle.

Severity

There is a workaround, so: bug-s3: a feature is broken but there is a workaround

However:

Your Environment

Possible Fix

basilawwad commented 8 months ago

Hi, I would like to work on this, can you assign it to me?

sigmundpetersen commented 8 months ago

Thank you @basilawwad , I'll assign you!

RachL commented 6 months ago

Hello @basilawwad I hope this message finds you well. Are you still planning to work on this issue? Let us know if you need more info!