Open GoogleCodeExporter opened 9 years ago
I have encountered this on any Inventory item that has had a transaction
associated with it, whether that be restocking, moving, taking out, etc. I
suppose the argument could be made that this preserves an audit trail, so that
you can see what transactions were taken on an item, even if that item is no
longer in stock. Since pretty much every other field is editable, if you make
an error, it should be correctable.
However, for testing purposes, this is a problem, as you don't want test items
left in inventory. The only way I found to remove these items was to edit the
table directly. Unfortunately, there's a bit of table traversal that you'll
have to do to remove the rows without leaving dependencies on other tables. I
believe you have to edit inventory_transaction, inventory_location and
inventory_model in that order. That said, better practice would be to have
separate instances of TracMor for testing and production.
Original comment by msmit...@gmail.com
on 16 Jun 2010 at 10:29
You can always change the ON DELETE to CASCADE.
In inventory_transaction change:
'inventory_location_id' to ON DELETE to CASCADE
In inventory_location change:
'inventory_model_id' to ON DELETE to CASCADE
You should then be able to remove Inventory that has transactions.
Original comment by bromley...@gmail.com
on 25 Jun 2010 at 2:19
Original issue reported on code.google.com by
winston....@gmail.com
on 18 Aug 2009 at 4:44