uzerpllp / uzerp

uzERP - Open Source Business Management
http://www.uzerp.com
Other
53 stars 26 forks source link

Inconsistency on belongsto relationship where columns are dependent #96

Closed steveblamey closed 6 years ago

steveblamey commented 8 years ago

We've had two issues where the database has ended up with an inconsistency because a dropdown didn't populate before the user submitted the form (I believe). There seems to be no backend validation of data where one 'belongsto' relationship 'depends' on another.

  1. Lynette entered an order header and ended up with an incorrect delivery address for the customer - I assume the delivery address dropdown had not 'ajaxed' before she pressed submit. Thus the order header had the delivery address id of AAH Pharma (the first customer in the dropdown), even though she'd selected CLF Distribution as the customer. The order in question is 12942 (id 12996).
  2. Karen was putting on a structure and the structure item ended up with an incorrect UOM of 'case' when the item in question only has a UOM of 'Kilo' - again 'case' is the UOM of the first stock item in the 'firing' drop down. This was then pulled through to the works oder. The works order is 12655 (id 12678)

Obviously the db ended up with a 'valid' id in the column because its a 'belongsTo' in each model and the backend sees it as a FK - but the 'context' is incorrect.

steveblamey commented 8 years ago

@mshiner It seems that uzERP uses the jQuery BlockUI Plugin http://malsup.com/jquery/block/ to prevent user interaction when an ajax request is in progress. You will see that the screen darkens and the mouse cursor changes when you select a new customer while adding a new sales order, for example.

There is no ajax request when the page is loaded initially, so the cause of this issue must be elsewhere.

steveblamey commented 6 years ago

We have not seen any repeat of these issues and have been unable to reproduce.