Replace entity relationships between products and stock locations with an entity link

Description

The product.medication and product.merchandise archetypes may each have entityRelationship.productStockLocation relationships to the party.organisationStockLocation archetype.
This is a bidirectional relationship, so a party.organisationStockLocation instance may have many products associated with it.
This affects performance on databases with thousands of products.

A better approach would be to replace the entityRelationship.productStockLocation with an EntityLink relationship. This would be from the product to the stock location.

Note that this change would mean that:

  • products can no longer be added to or removed from a stock location - this can only be done by editing the product

  • a list of products for a stock location cannot be determined by looking at the stock location.

This would require the following changes:

  • replace entityRelationship.productStockLocation with entityLink.productStockLocation

  • update product archetypes to use entityLink.productStockLocation

  • remove products node from party.organisationStockLocation

  • classes:

    • ProductCopyHandler

    • ProductTestHelper

    • StockArchetypes

    • StockRules

    • DeliveryProcessor

  • report changes:

    • ./reports/Reporting/Reports/Product/A4/Stock Reorder Report.jrxml

    • ./reports/Reporting/Reports/Product/A4/Stock Valuation Report.jrxml

    • ./reports/Reporting/Reports/Product/A4/Stocktake List.jrxml

  • database migration

Users would need to manually install the reports, and update any of their customised reports.

Environment

None

Status

Assignee

Tim Anderson

Reporter

Tim Anderson

Labels

None

Fix versions

Affects versions

1.7

Priority

Minor
Configure