Bug 332795

Summary: Can't delete security if price entries still exist
Product: [Applications] kmymoney Reporter: Michael T. Garrison Stuber <garrisonstuber>
Component: generalAssignee: KMyMoney Devel Mailing List <kmymoney-devel>
Status: RESOLVED FIXED    
Severity: wishlist CC: erwin.vandevelde
Priority: NOR    
Version: git (master)   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In: 5.0
Sentry Crash Report:

Description Michael T. Garrison Stuber 2014-03-30 05:19:04 UTC
Even if you remove all transactions associated with a security, you can't delete the security from KMM until every stock price quote has been deleted.  While it's possible to do this manually, it's a bit tedious, and it's also non-obvious.  Suggest adding a feature where the user is allowed to delete a security once all transactions have been removed, and is prompted, "Investment price quotes exist.  Do you still want to delete this security?  All price quotes will also be deleted."
The user could then cancel or delete.

Reproducible: Always

Steps to Reproduce:
1.  Create a investment
2.  Add some prices or grab them via online quoting services
3.  Create some transactions for the investment
4.  Delete all transactions
5.  Attempt to delete security
Actual Results:  
6. Deletion not allowed

Expected Results:  
6. Prompt user:  "Investment price quotes exist.  Do you still want to delete this security?  All price quotes will also be deleted."
7. Delete or cancel as per user
Comment 1 wojnilowicz 2017-03-25 07:22:33 UTC
Git commit 3546febfef8ddd8a865044d3a5150b83d06e4f9b by Łukasz Wojniłowicz.
Committed on 25/03/2017 at 07:21.
Pushed by wojnilowicz into branch 'master'.

Delete prices during deleting security
FIXED-IN:5.0

Differential Revision: https://phabricator.kde.org/D4943

Signed-off-by: Łukasz Wojniłowicz <lukasz.wojnilowicz@gmail.com>

M  +36   -6    kmymoney/views/kinvestmentview.cpp

https://commits.kde.org/kmymoney/3546febfef8ddd8a865044d3a5150b83d06e4f9b
Comment 2 wojnilowicz 2017-08-20 15:23:52 UTC
*** Bug 316223 has been marked as a duplicate of this bug. ***