Autoupdate on by Default

I had made a decision to enable AUTOPRICEUPDATING as ON by default for newly created product supplier relationships however a number of archetype tests will fail in this scenario generally due to the fact that the expected test result is for autopriceupdate to be off

// create a product-supplier relationship.
// By default, it should not trigger auto price updates
int packageSize = 20;
ProductSupplier ps = createProductSupplier();
ps.setPackageSize(packageSize);
assertFalse(ps.isAutoPriceUpdate());
ps.save();
  • openvpms-archetypes (org.openvpms:openvpms-archetypes:1.8-beta-2-SNAPSHOT)
  • DeliveryProcessorTestCase (org.openvpms.archetype.rules.supplier)
    • testUnitPriceUpdate 
  • ProductPriceUpdaterTestCase (org.openvpms.archetype.rules.product)
    • testUpdateFromMerchandise
    • testUpdateFromMedication 

However I am just checking that this is just a testcase construct and does not cause real world problems when used.  

The major one I can forsee is the creation of a product supplier relationship where the List price is 0 and not changed on construction -- automatically setting the unit price to 0 until that price is updated either via an order delivery or manually.

I had thought the solution to this was to set an assertion as non 0 (not yet implemented but wanted to know if this would cause any catastrophic breakages)

 

 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Re: Autoupdate on by Default

It should be OK.

Rather than change openvpms-archetypes however, it may be easier to create a separate release package that replaces the standard archetypes with your own customisations.

This way, you don't have to modify the standard unit tests so that they meet your practice specific customisations.

Syndicate content