Bug 459637

Summary: Can not delete securities
Product: [Applications] kmymoney Reporter: Gustav Delius <gustav.delius>
Component: generalAssignee: KMyMoney Devel Mailing List <kmymoney-devel>
Status: REPORTED ---    
Severity: normal    
Priority: NOR    
Version First Reported In: 5.1.3   
Target Milestone: ---   
Platform: unspecified   
OS: Microsoft Windows   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Simple .kmy file for reproducing the problem

Description Gustav Delius 2022-09-25 10:02:10 UTC
Created attachment 152406 [details]
Simple .kmy file for reproducing the problem

SUMMARY

In the attached small test.kmy file there are two securites. Neither has an associated transaction in any of the accounts. Nevertheless the "Delete" button on the Securities page is greyed out. The file passes the consistency check.

STEPS TO REPRODUCE
1. Open test.kmy
2. Go to "Investments" -> Securities
3. Select a security

OBSERVED RESULT

"Delete" button is greyed out

EXPECTED RESULT

Delete button is active


SOFTWARE/OS VERSIONS
Windows:  10 Version 2009 (x86_64)
kmymoney 5.1.3-5b03a2216

ADDITIONAL INFORMATION

The test.kmy file was created by first creating a new empty file and then importing a qif file and creating the investment and brokerage accounts during the import dialog. I then deleted the two transactions and observed the above problem. To allow the file to pass the consistency check I added prices to the two securities. That did not affect the reported problem. I am copying the content of the qif file below:

!Type:Invst
D29/12'2000
T6,724.90
NShrsIn
Y3.4% Dresdner 2003
I96.07
Q70
^
D29/12'2000
T84,031.83
NShrsIn
Y4.375 Dresdner 2003
I99.09
Q848.035422
^
Comment 1 Gustav Delius 2022-09-25 10:39:22 UTC
Just to confirm that the problem with deleting securities also arises if the security is created by hand rather than via qif import.  To reproduce:

1) Create new file with no accounts
2) Create an investment account and associated brokerage account
3) On Investment page right-click and choose New Investment
4) Create investment
5) Go to securities tab and try to delete the newly creates security