Bug 486793 - Cannot change name or delete security
Summary: Cannot change name or delete security
Status: REPORTED
Alias: None
Product: kmymoney
Classification: Applications
Component: general (show other bugs)
Version: 5.1.3
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-05-08 20:25 UTC by Freddy
Modified: 2024-05-08 22:34 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Freddy 2024-05-08 20:25:02 UTC
SUMMARY
Once a security has been created, changing it's display name (Full name) has no effect, and the security can not be deleted even if there are no transactions and no price entries linked to it.

STEPS TO REPRODUCE

1. Create a new .kmy file
2. Add an investment account
3. Add a new security (Stock, Trading symbol ACME, Full name ACME Corporation)
4. Change full name to something else ("Big Bad Corp")
5. Go to the ledger and open a new transaction "Buy shares", abort the transaction.
6. Go back to the securities page and highlight Big Bad Corp to delete it.

OBSERVED RESULT

- In step 5, the security still shows up as "ACME Corporation" in the form.
- In step 6, the delete button is not clickable.

EXPECTED RESULT

The security should show up as "Big Bad Corp" in step 5 and the delete action should be available in step 6

SOFTWARE/OS VERSIONS

Linux/KDE Plasma: openSUSE Tumbleweed 20240421 
KDE Plasma Version:  6.0.4
KDE Frameworks Version: 6.1.0
Qt Version: 6.7.0

ADDITIONAL INFORMATION
Comment 1 Jack 2024-05-08 22:34:07 UTC
Something does seem strange, although I can't fully replicate your report.
To create a security within an Investment Account (other than imlpicitly by adding or buying shares) you need to do so on the equities tab of the Investments View.  This creates the security (which can then be seen on the Securities tab of the Investments View.  When you do this, it creates the security, which contains all the information about the stock.  It also creates the ACME sub account of the Investment account, which is what holds any transactions regarding that stock in that investment account.  This can then be seen as a sub account of the Investment account on the Accounts view (possibly depending on configuration settings.)  What is odd (and debatably a bug( is that it is NOT seen on the Equities tab of the investments view, probably because it does not contain any shares.  If you delete the Acme subaccount of the Investment account on the Accounts View, you will then be able to delete the entry for it on the Securities tab.

Regarding seeing the wrong name when you try to buy shares after changing the name by editing the stock on the Securities Page of the Investments View, I am not able to replicate this.  However, it is likely that you changed the name of the security (once per KMM fil) but not the name of the acme subaccount of the investment account, which is what shows up in the security dropdown for investment transactions.  I'm not sure if this issue of name consistency has been addressed in master branch, but I know some work has been done in this area to avoid inadvertently creating multiple securities when you more likely want multiple equities (in different Investment accounts.)

Current workaround(s)
1) understand that the name in the security dropdown in an investment transaction in an Investmente account is the name from the subaccount for that stock.  While these names SHOULD always be the same, they are not always so.
2) if that stock does not show up on the Equities tab of the Investments View, look for the subaccount of the Investment Account  on the Accounts View.

I see two areas for possible work:
1) show a stock on the Equities Tab even if it does not contain any shares
2) assure the name is the same for all Equities for a single Security.