Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add foreign key constraint for transaction.requisition_id #108

Closed
jmiranda opened this issue Sep 18, 2015 · 0 comments
Closed

Add foreign key constraint for transaction.requisition_id #108

jmiranda opened this issue Sep 18, 2015 · 0 comments
Assignees
Labels
type: bug Addresses unintended behaviours of the app
Milestone

Comments

@jmiranda
Copy link
Member

Yesterday, I had to deal with an issue where PIH Liberia had deleted a requisition, but the transactions underlying that requisition were left intact including the deleted requisition_id (see OBPIH-349: Stock history viewing issue: JY51). The bug manifested itself by not allowing users to view the stock history for a product at a certain location. This is a blocker and should be dealt with immediately to prevent unintended loss of data.

2015-09-17 21:17:54,541 [ajp-bio-8009-exec-2] INFO  inventory.InventoryItemController  - inventoryItem.showStockHistory: 24 ms
2015-09-17 21:17:55,067 [ajp-bio-8009-exec-2] ERROR errors.GrailsExceptionResolver  - Exception occurred when processing request: [GET] /openboxes/inventoryItem/showStockHistory/c879370c4a13ffdf014a15e2cb6500c1
Stacktrace follows:
org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [org.pih.warehouse.requisition.Requisition#c879370c4cdfd123014ce136632600c3]
    at gsp_openboxes_inventoryItem_showStockHistory_gsp$_run_closure1_closure3_closure5.doCall(gsp_openboxes_inventoryItem_showStockHistory_gsp.groovy:203)
    at gsp_openboxes_inventoryItem_showStockHistory_gsp$_run_closure1_closure3.doCall(gsp_openboxes_inventoryItem_showStockHistory_gsp.groovy:79)
    at gsp_openboxes_inventoryItem_showStockHistory_gsp$_run_closure1.doCall(gsp_openboxes_inventoryItem_showStockHistory_gsp.groovy:77)
    at gsp_openboxes_inventoryItem_showStockHistory_gsp$_run_closure1.doCall(gsp_openboxes_inventoryItem_showStockHistory_gsp.groovy)
    at gsp_openboxes_inventoryItem_showStockHistory_gsp.run(gsp_openboxes_inventoryItem_showStockHistory_gsp.groovy:295)
    at org.pih.warehouse.inventory.InventoryItemController$_closure7.doCall(InventoryItemController.groovy:139)
    at org.pih.warehouse.inventory.InventoryItemController$_closure7.call(InventoryItemController.groovy)
    at grails.plugin.springcache.web.GrailsFragmentCachingFilter.doFilter(GrailsFragmentCachingFilter.groovy:66)
    at net.sf.ehcache.constructs.web.filter.Filter.doFilter(Filter.java:86)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)
@jmiranda jmiranda added the type: bug Addresses unintended behaviours of the app label Sep 18, 2015
@jmiranda jmiranda added this to the 0.7.4 milestone Sep 18, 2015
@jmiranda jmiranda self-assigned this Sep 18, 2015
@jmiranda jmiranda changed the title Check whether transaction.requisition_id has foreign key constraint Add foreign key constraint for transaction.requisition_id Sep 18, 2015
@jmiranda jmiranda added the ready label Oct 6, 2015
@jmiranda jmiranda modified the milestones: 0.7.9, 0.8.0 May 6, 2016
jmiranda added a commit that referenced this issue May 6, 2016
* added missing primary keys and foreign key constraints to several tables (fixed #62, #108)
* bumped app version to 0.7.9
@jmiranda jmiranda closed this as completed May 6, 2016
@jmiranda jmiranda removed the ready label May 6, 2016
jmiranda added a commit that referenced this issue May 10, 2016
* Hotfix 0.7.8 (#141)

* minor cleanup to prevent the assign identifier quartz job from throwing hundreds of "Duplicate key" errors if the pool of identifiers is small enough to cause lots of collisions

* removed unnecessarily verbose logging from inventory service

* Purchase Order UI changes to make it more consistent with other pages

* fixed #133: added ability to import order line items into an existing order; also added rollback feature

* fixed #50: Illegal attempt to associate a collection with two open sessions when receiving against purchase order

* Minor enhancements to make UI a little more consistent across entire app

* bumped app version to 0.7.8

* removed annoying inventory sampling report constraint

* fixed #89: made significant performances improvements to the dashboard

* Removed errant text that was committed by accident

* Hotfix/62 missing foreign key constraints (#145)

* added missing primary keys and foreign key constraints to several tables (fixed #62, #108)
* bumped app version to 0.7.9

* Fixed unit test for the show inventory report feature
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Addresses unintended behaviours of the app
Projects
None yet
Development

No branches or pull requests

1 participant