GNOME Bugzilla – Bug 677489
Critical error reported when initializing an Invoice
Last modified: 2018-06-29 23:08:59 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__.
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 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 ?
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
That's all I needed to know. Bug closed. Thank you very much!
Reassign version to 2.4.x so that individual 2.4 versions can be retired.
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.