GnuCash
Contact   Instructions
Bug 798177 - Price of new stock transactions not saved in price database
Summary: Price of new stock transactions not saved in price database
Status: RESOLVED FIXED
Alias: None
Product: GnuCash
Classification: Unclassified
Component: Currency and Commodity (show other bugs)
Version: 4.5
Hardware: PC Linux
: Normal normal
Target Milestone: ---
Assignee: core
QA Contact: core
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-04-22 05:38 EDT by csw
Modified: 2021-04-26 15:14 EDT (History)
3 users (show)

See Also:


Attachments

Description csw 2021-04-22 05:38:03 EDT
When entering a new transaction, e.g. a stock buy, the price is not saved in the price database.

I am using GnuCash version 4.5-2 on archlinux. It worked fine with version 4.4-1, but i cannot tell if the error occurred after updating from 4.4-1 to 4.5-1 or from 4.5-1 to 4.5-2
Comment 1 John Ralls 2021-04-22 11:58:51 EDT
I can't reproduce by doing the obvious, so what exactly are you doing?

Arch's 4.5-2 is just a rebuild with a new version of ICU. It wouldn't have anything to do with this.
Comment 2 csw 2021-04-22 14:00:07 EDT
Thank you for the quick reply. Please try the following:

- create a new account of type stock
- in the Security/Currency field select "New" and create one (e.g. "MSFT")
- open the account register
- enter a new transaction and buy 1 MSFT with a price of 250

I would now expect an entry like the following in the price database

MSFT USD 22.04.2021 user:split-register transaction 250

but instead no entry is created.
Comment 3 John Ralls 2021-04-22 15:39:59 EDT
That's what I did, though with a fictitious stock ABC, a price of $5, and an amount of 10 shares.

Note that the price will appear in the namespace that you chose for MSFT when creating the security. In my case I used AMEX because it's the default in the Security Editor so when I committed the transaction a new top-level AMEX appeared in the PriceDB window; clicking its disclose triangle revealed ABC, and clicking *its* reveal triangle revealed the new price.
Comment 4 csw 2021-04-22 16:04:37 EDT
This is really strange. I've been using GnuCash for years and it worked just as described.

Now, the newly created stock *does* appear in the securities editor (under the correct namespace). However, in the PriceDB window, no entries exist.

Tomorrow I will try to downgrade to version 4.4 and see if the problem persists.
Comment 5 csw 2021-04-23 10:15:32 EDT
I can now confirm that version 4.4 works as expected. The problem occurs after the update to version 4.5-1

I've seen that with 4.5 came "Update price database for imported transaction" (https://github.com/Gnucash/gnucash/pull/920)

Could that have something to do with it?
Comment 6 John Ralls 2021-04-23 11:51:19 EDT
Not likely.
As I said in comment 1, I've confirmed that yesterday's GnuCash maint built from source on Arch Linux immediately after running `sudo pacman -Syuu` correctly updates the pricedb when creating a transaction. That indicates that your problem is either with Arch's packaging of GnuCash or some weird interaction with something else installed on your system. That it doesn't occur with 4.4 points towards a packaging problem. I suggest you raise the issue at https://bugs.archlinux.org or contact the Arch Linux packager and get them to help debug it.
Comment 7 csw 2021-04-25 14:25:20 EDT
It's me again. I've narrowed down the problem, it depends on how you enter the transaction. 

It *works* if I enter it like follows:

Hit <Tab> until the field for the number of shares, enter "1", <Tab>, enter price ("250"), <Tab> twice, we are now on the next line, select the account from the drop down menu and press <Enter>

However, if i don't press <Enter> and hit instead <Tab> five times to get to the next line (and get rid of the little "x"s) and hit <Enter> on the (empty) third line, the price is *not* recorded in the PriceDB.

I hope you understand what I mean.
I don't think it is a packaging problem as I have now built from source, too.
Comment 8 John Ralls 2021-04-25 14:46:52 EDT
Aha! Yes, I can reproduce that.
Comment 9 John Ralls 2021-04-26 15:14:45 EDT
Fixed in git, so it will be in tomorrow's nightlies and GnuCash 4.6.

Note You need to log in before you can comment on or make changes to this bug.