No products on Stock Management screens for freshly-configured facilities

Description

Currently our system doesn't include available products on Stock Management screens for just-created facilities. Even on the Physical Inventory screen there are no products to add to such a facility even though the products were loaded, assigned to a program and facility type.

As a workaround it is possible to create a requisition with available products at first. After approving it (so sending a stock event) the products are added to Physical Inventory screen and other Stock Management screens.

The workaround, however, is not acceptable when there will be hundreds of facilities to configure. We should change this logic, so that the products can be added to the Physical Inventory and other Stock Management screens.

Reproduction steps:

  1. Add a new facility (e.g. associated program: Family Planning, facility type: Health Center, geographic zone: Neno District)

  2. On the Products screen, choose the first product and add a new Program Orderable to it (Family Planning)

  3. For the same product at Facility Types tab add FTAP (Health Center, Family Planning)

  4. Set the new facility as Home Facility to any user

  5. Assign the Stock Manager role for Family Planning to the user

  6. Log out and log in as the user

  7. Proceed to the Stock Management → Physical Inventory screen and choose Family Planning program

  8. Open the Add Products modal

  9. Only Levora is available in the dropdown

Expected result:
It is possible to add to the Physical Inventory any products in the system available for given program.

Environment

None

Activity

Show:
Wojciech Buława
May 15, 2020, 11:58 AM

Before we will be able to add to the Physical Inventory a product (orderable) available for a given program:

  1. A facility has to be associated with the program Home → Administration → Facilities → Edit Facility → Associated Programs

  2. A reference between the program and the orderable has to be created and stay active Home →Administration → Products → Edit Product → Programs

  3. The product has to be connected with a facility type of the facility using FTAP (Facility Type Approved Product) Home →Administration → Products → Edit Product → Facility Types

So the reproduction steps should be:

  1. Add a new facility (e.g. associated program: Family Planning, facility type: Health Center, geographic zone: Neno District)

  2. On the Products screen, choose the first product and add a new Program Orderable to it (Family Planning)

  3. For the same product at Facility Types tab add FTAP (Health Center, Family Planning)

  4. Set the new facility as Home Facility to any user

  5. Assign the Stock Manager role for Family Planning to the user

  6. Log out and log in as the user

  7. Proceed to the Stock Management → Physical Inventory screen and choose Family Planning program

  8. Open the Add Products modal

  9. Only Levora is available in the dropdown

Wojciech Buława
May 18, 2020, 4:21 PM
Edited

Review – https://review.openlmis.org/cru/FEOLMIS-4111#details

Approved products and orderable fulfill map are sets of orderables which may be equal in some cases. The orderableFulfillMap is often a smaller set of orderables then the approved products. This information was missing in this commit, so I have reverted it.

Wojciech Buława
May 19, 2020, 9:15 AM

fix is available at https://test.openlmis.org/

Joanna Szymańska
May 20, 2020, 1:17 PM

Tested with success.

Verified on Version 80.0.3987.163 (Official Build) (64-bit)

Verified cases:

  • I verified cases with new facility and products;

  • I also verified cases after editing existing facilities and products that were not previously available for some program.

Assignee

Wojciech Buława

Reporter

Paulina Buzderewicz

Labels

Story Points

3

Time tracking

16h

Components

Sprint

None

Fix versions

Due date

2020/05/19

Priority

Major
Configure