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 677489 - Critical error reported when initializing an Invoice
Critical error reported when initializing an Invoice
Status: RESOLVED FIXED
Product: GnuCash
Classification: Other
Component: Python Bindings
2.4.x
Other Linux
: Normal normal
: ---
Assigned To: Mark Jenkins
Mark Jenkins
Depends on:
Blocks:
 
 
Reported: 2012-06-05 16:13 UTC by Jan-Oliver Kaiser
Modified: 2018-06-29 23:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to resolve issue (1.33 KB, patch)
2014-01-23 06:27 UTC, Tom Lofts
committed Details | Review

Description Jan-Oliver Kaiser 2012-06-05 16:13:56 UTC
The following error message appears every time I create an object of the Invoice class. 

CRIT <gnc.backend.sql> gnc_sql_save_commodity: assertion
`pCommodity != NULL' failed 

It does not appear to be critical. However, due to #677488, I have not yet managed to save such an Invoice.

This error can be prevented by calling SetID after SetCurrency in Invoice.__init__.
Comment 1 Tom Lofts 2014-01-23 06:27:56 UTC
Created attachment 267023 [details] [review]
Patch to resolve issue

Hi there,

I've created a patch which should resolve this issue by the addition of BeginEdit() and CommitEdit() functions to the invoice class.

I also believe this may be required in some other classes in gnucash_business.py as well, so will look to provide a patch for these areas as well after I've reviewed the issue and tested an additional patch.

Kind regards,

Tom
Comment 2 Geert Janssens 2014-01-25 10:16:37 UTC
Comment on attachment 267023 [details] [review]
Patch to resolve issue

Hi Tom, thank you for the patch. I have committed it as r23763.

Your description explains it will fix invoice creation. Will it also fix the critical warning the OP reported or should SetID be called still ?
Comment 3 Tom Lofts 2014-01-25 13:46:49 UTC
Hu Geert,

Thanks for committing this fix. I can confirm the fix resolves the critical warning and avoids the need to call SetID as well.

If you need any further information on this please let me know.

Kind regards,

Tom
Comment 4 Geert Janssens 2014-01-25 13:53:26 UTC
That's all I needed to know. Bug closed.

Thank you very much!
Comment 5 John Ralls 2017-09-24 22:48:54 UTC
Reassign version to 2.4.x so that individual 2.4 versions can be retired.
Comment 6 John Ralls 2018-06-29 23:08:59 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=677489. Please update any external references or bookmarks.