Bug 396174 - Cannot create new investment
Summary: Cannot create new investment
Status: RESOLVED FIXED
Alias: None
Product: kmymoney
Classification: Applications
Component: general (show other bugs)
Version: 5.0.0
Platform: Ubuntu Linux
: NOR major
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-07-04 20:57 UTC by Wolfgang Rohdewald
Modified: 2018-08-24 15:59 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 5.0.2


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wolfgang Rohdewald 2018-07-04 20:57:33 UTC
maybe this should be several bug reports.

1. Help/About says I have version 5.0.0, but the detail error message below seems to say I have 5.0.1

When creating a new investment, I get

       Unable to create all objects for the investment

The second bug is that pressing the button "Details" does not show any details. They only get visible if I manually enlarge the window. It should enlarge itself automatically.

The detailled error message says:

Stock account cannot be parent account caugt in /build/kmymoney-8Tb1zm/kmymoney-5.0.1/kmymoney/mymoney/mymoneyfile.cpp:1059

So what exactly is a stock account? I cannot see this anywhere in the user interface, there it seems to be an Equity. So maybe the error message should be "Equity cannot be parent" - that would certainly have helped me to discover a workaround solution, see below.

How to reproduce:

1. select the page "Investments"
2. select an account
3. now one of the equities has light blue as background
4. right mouse click BELOW the list of equities: Now I can add an equity, everything is fine.
5. now one of the equities has DARK blue as background
6. right click anywhere and create new equity. The above error appears.

It seems that kmymoney tries to use a selected equity as parent for the new equity. I cannot imagine a situation in real life where this makes sense.
Comment 1 Jack 2018-07-04 21:03:47 UTC
The wrong version number (5.0.0 displayed in 5.0.1) is a known issue.

I've seen many cases of the details window being too small to see the details without manually making it larger.  I don't know if this is really a KMyMoney issue or some underlying library, but someone will have to look to see if there is some parameter when creating/displaying that window that will help.  It might be a regression when moving to Frameworks.

As far as I can tell, creating a Stock (or Equite) account should be automatic and I can't think of any way it could possible be a parent account, especially at the time of creation.  I have not yet tried to recreate this - your instructions look good, so I wonder if in the process of creating the second stock, something is not getting deselected and is being used as the parent of the new stock instead of using the main investment account.
Comment 2 Thomas Baumgart 2018-07-07 12:38:01 UTC
Could it be, that this is already fixed in master? I cannot reproduce it.

How to I get to the details button? I did not find it?
Comment 3 Wolfgang Rohdewald 2018-07-07 12:49:31 UTC
this one:

kmymoney/wizards/newinvestmentwizard/knewinvestmentwizard.cpp:    KMessageBox::detailedSorry(this, i18n("Unable to create all objects for the investment"), QString::fromLatin1(e.what())); 

I looked at the latest commits but I saw nothing about this.

A simpler step list:

1. go to investments
2. select an equity account
3. select an existing investment
4. right click ANYWHERE to create a new investment
5. this fails for me.

BTW is there any way to remove an investment again? If I simply create one without ever using it, I think I should be able to delete it in the Securities tab. But the Delete button is grayed out.
Comment 4 Thomas Baumgart 2018-07-07 19:37:38 UTC
This seems to be fixed in master. I remember that I was working on this at some point in time. Possible related commits are f1a04e2f29c, 15ca4f5fce44 and 1c3dfb32f903fa.