agritheory / beam

General Purpose 2D barcode scanning for ERPNext
https://agritheory.com/documentation/beam/
Other
20 stars 9 forks source link

Validation: Mandatory handling unit #92

Closed viralkansodiya closed 2 months ago

viralkansodiya commented 3 months ago

if stock entry type is not 'Material Receipt' and Item has enabled handling unit feature then handling unit should be mandatory

viralkansodiya commented 3 months ago

Process to merge this PR after merging #88

agritheory commented 2 months ago

@viralkansodiya With this feature added, some tests are now failing and we should address that.

To align with the bakery narrative of the tests, "Water" and "Ice Water" items should not have handling units and we should change this in tests/setup.py.

To fix the repack tests, we only need to add the handling unit key collected here into this dictionary. That said, the quality of this test that I originally wrote could be improved by simulating a scan, like we do here.

Let me know if you run into any trouble.

viralkansodiya commented 2 months ago

@agritheory At this point, we need to modify the validation of mandatory handling units based on the type of stock entry.

For example:

  1. If the stock entry type is 'Repack', the handling unit should be mandatory unless it is a finished item.

  2. If the stock entry type is 'Manufacturing', the handling unit should be mandatory only for raw materials, not for finished items.

Similarly, we should consider other types of stock entry as well."

Please give your suggestion