After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 724738 - Value in "Display Symbol" field not saved
Value in "Display Symbol" field not saved
Status: RESOLVED FIXED
Product: GnuCash
Classification: Other
Component: Currency and Commodity
2.6.1
Other Windows
: Normal normal
: ---
Assigned To: gnucash-core-maint
gnucash-core-maint
Depends on:
Blocks:
 
 
Reported: 2014-02-19 16:49 UTC by Stefano Fiorini
Modified: 2018-06-29 23:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Saves the user symbol when editing non-currency commodities. (1003 bytes, patch)
2015-04-04 11:15 UTC, yomlogs
committed Details | Review

Description Stefano Fiorini 2014-02-19 16:49:36 UTC
In the Security editor, if a value is entered in the "Display symbol" Filed, it is not saved and also it is not displayed in "Securities", even if the column is shown. Reopening the editor shows an empty field.
Steps to reporduce:
1. Tools -> Security Editor
2. In the "Securities" window, click "Add"
3. in the "Edit security" window enter:
	- "AAAA" in "Full name" field
	- "BBBB" in "Symbol/abbreviation" field
	- "CCCC" in "Display symbol" field
4. Take note of the value in "Type" field (happens with any value)
5. Click "OK"
6. Find the newly created security in "Securities" window, under the "Type" you noted at step 4.
7. Make sure that "Display symbol" column is shown
8. Notice that there is no value in that column for the newly created security
8. Select new security and click "Edit"
9. Notice that the "Display symbol" field is empty (should contain "CCCC" instead)

The same thing goes on if I try to add e "display symbol" for a security already existent.

OS: Windows 7
Comment 1 Stefano Fiorini 2014-02-19 17:02:19 UTC
The same bug applies to 2.6.0 too
Comment 2 yomlogs 2015-04-04 11:15:14 UTC
Created attachment 300941 [details] [review]
Saves the user symbol when editing non-currency commodities.

gnc_ui_commodity_dialog_to_object() only calls gnc_commodity_set_user_symbol() if the commodity is a currency. This one-line patch ensures the same is done for non-currency commodities as well.

Not extensively tested, but it appears to work without ill effects.
Comment 3 John Ralls 2015-04-04 14:06:49 UTC
What's the actual use-case for this?

There are two symbols for currencies, which have both an ISO-4217 code (e.g. USD) and customary (but not standardized) symbols used for displaying amounts, e.g. $. For what non-currency commodities is this true?
Comment 4 yomlogs 2015-04-04 14:26:39 UTC
My own use-case is a number of commodities (funds) where the symbol is rather long and unwieldy, but must be stored in that way in order to work with online price quote fetching. It would be preferable to see a shortened (customised) version next to displayed amounts.

This would appear to be a good use for the user symbol field. If this is valid for currencies, why not any commodity type?

As it stands, the UI does not actually make use of the user symbol when displaying non-currency amounts - it still displays the full symbol name. I was going to raise another bug and propose a further patch to address this, should this first patch be accepted.
Comment 5 Frank H. Ellenberger 2015-04-04 18:12:45 UTC
I like the idea to have a short display symbol for commodities. Fetching commodities by yahoo I often have 12 chars ISIN + upto 4 chars appendix to select a market or currency ending up in 16 char long symbols, which is really noisy in the CoA.

But I am not shure, it should be done in the locale symbol. Probably we should distinguish locale symbol and display symbol. IMHO that discussion  should be done in bug 723145 or a new thread.
Comment 6 Stefano Fiorini 2015-04-04 21:56:19 UTC
(In reply to yomlogs from comment #4)
> My own use-case is a number of commodities (funds) where the symbol is
> rather long and unwieldy, but must be stored in that way in order to work
> with online price quote fetching. It would be preferable to see a shortened
> (customised) version next to displayed amounts.
> 
> This would appear to be a good use for the user symbol field. If this is
> valid for currencies, why not any commodity type?:

Same use case here, i have some funds with symbols ranging from 20 to 50 chars (in fact I had to use the entire fund name), and it is really really annoying in the UI
Comment 7 Geert Janssens 2015-08-27 14:14:14 UTC
I've been wanting to review this patch a long time ago, but
just didn't find the time to do so. Apologies for the delay.

The patch is close to a full solution. It however only saves
the user symbol if the user is editing an existing commodity,
not when if the user specifies a user symbol while creating
a new commodity.

The fix for that is trivial, so I have made the necessary change
before commiting your patch to maint. The improvement will appear
in the next stable gnucash release (2.6.8).

Thank you for your contribution and once again apologies for the
long delay.
Comment 8 John Ralls 2018-06-29 23:26:52 UTC
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=724738. Please update any external references or bookmarks.