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 639980 - python fails getting invoice entry data
python fails getting invoice entry data
Status: RESOLVED FIXED
Product: GnuCash
Classification: Other
Component: Python Bindings
git-master
Other Linux
: Normal normal
: ---
Assigned To: Mark Jenkins
Mark Jenkins
Depends on:
Blocks:
 
 
Reported: 2011-01-19 19:17 UTC by gnome-bugzilla
Modified: 2018-06-29 22:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add EntryList and _gncEntry objects to list typemap. (951 bytes, patch)
2011-01-19 19:17 UTC, gnome-bugzilla
committed Details | Review
Script that exercises the bug. (540 bytes, text/x-python)
2011-01-19 19:19 UTC, gnome-bugzilla
  Details

Description gnome-bugzilla 2011-01-19 19:17:03 UTC
Created attachment 178765 [details] [review]
Add EntryList and _gncEntry objects to list typemap.

I'm trying to use the python bindings to fetch entry (line-item) data
from an invoice.

See http://pastebin.com/fy06CPup for the test GnuCash XML file I'm using. (It just has two accounts and an invoice with three line items.)

I expect the attached script to print the three line items from the
invoice in that file, but instead it dies with:

% gnucash-env python invoice_read.py test2.gnucash
* 15:07:39  WARN <gnc.backend.dbi> [gnc_module_init_backend_dbi()] No
DBD drivers found
Traceback (most recent call last):
  • File "invoice_read.py", line 16 in <module>
    print entry.GetDescription()
  • File "/usr/lib/python2.6/dist-packages/gnucash/function_class.py", line 92 in method_function
    *process_list_convert_to_instance(meth_func_args) )
  • File "/usr/lib/python2.6/dist-packages/gnucash/gnucash_core_c.py", line 3825 in gncEntryGetDescription
    return _gnucash_core_c.gncEntryGetDescription(*args)
TypeError: in method 'gncEntryGetDescription', argument 1 of type
'GncEntry const *'

Other methods on the Entry objects yield similar results.

Running on Ubuntu Lucid. Tested with 2.4.0-1~getdeb1~lucid from
getdeb.net and from svn r20126 with the same results.

Patch attached.
Comment 1 gnome-bugzilla 2011-01-19 19:19:01 UTC
Created attachment 178766 [details]
Script that exercises the bug.
Comment 2 Christian Stimming 2011-01-20 09:44:22 UTC
Comment on attachment 178765 [details] [review]
Add EntryList and _gncEntry objects to list typemap.

Look good!
Comment 3 Christian Stimming 2011-01-20 20:21:53 UTC
Comment on attachment 178765 [details] [review]
Add EntryList and _gncEntry objects to list typemap.

r20129, thanks!
Comment 4 John Ralls 2018-06-29 22:52:25 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=639980. Please update any external references or bookmarks.