sdementen / piecash

Pythonic interface to GnuCash SQL documents
Other
290 stars 73 forks source link

Support GnuCash 4.1 #136

Closed EuPhobos closed 4 years ago

EuPhobos commented 4 years ago

This project are dead? Any update? There is only new version of "splits" table: gnucash=> select table_name, table_version from versions where table_name = 'splits'; table_name | table_version ------------+--------------- splits | 5

gregwalters commented 4 years ago

Splits hasn't actually been updated since 3.7. See https://github.com/sdementen/piecash/pull/130

If you apply this diff, piecash should work with 4.1:

diff --git a/piecash/core/session.py b/piecash/core/session.py
index 0fa321b..b16433f 100644
--- a/piecash/core/session.py
+++ b/piecash/core/session.py
@@ -72,6 +72,58 @@ version_supported = {
         'taxtables': 2,
         'transactions': 4,
         'vendors': 1,
+    },
+    '3.7': {
+        'Gnucash': 3000001,
+        'Gnucash-Resave': 19920,
+        'accounts': 1,
+        'billterms': 2,
+        'books': 1,
+        'budget_amounts': 1,
+        'budgets': 1,
+        'commodities': 1,
+        'customers': 2,
+        'employees': 2,
+        'entries': 4,
+        'invoices': 4,
+        'jobs': 1,
+        'lots': 2,
+        'orders': 1,
+        'prices': 3,
+        'recurrences': 2,
+        'schedxactions': 1,
+        'slots': 4,
+        'splits': 5,
+        'taxtable_entries': 3,
+        'taxtables': 2,
+        'transactions': 4,
+        'vendors': 1,
+    },
+    '4.1': {
+        'Gnucash': 4000001,
+        'Gnucash-Resave': 19920,
+        'accounts': 1,
+        'billterms': 2,
+        'books': 1,
+        'budget_amounts': 1,
+        'budgets': 1,
+        'commodities': 1,
+        'customers': 2,
+        'employees': 2,
+        'entries': 4,
+        'invoices': 4,
+        'jobs': 1,
+        'lots': 2,
+        'orders': 1,
+        'prices': 3,
+        'recurrences': 2,
+        'schedxactions': 1,
+        'slots': 4,
+        'splits': 5,
+        'taxtable_entries': 3,
+        'taxtables': 2,
+        'transactions': 4,
+        'vendors': 1,
     }
 }

@@ -348,7 +400,7 @@ def open_book(sqlite_file=None,
             break
     else:
         raise ValueError("Unsupported table versions")
-    assert version == "3.0", "This version of piecash only support books from gnucash 3.0.x " \
+    assert version == "3.0" or version == "3.7" or version == "4.1", "This version of piecash only support books from gnucash 3.0.x " \
                              "which is not the case for {}".format(uri_conn)

     book = s.query(Book).one()
peterb12 commented 4 years ago

Nice that this patch exists, but it still makes sense to do a new release since anyone using pip installs isn't helped by the patch existing.

gregwalters commented 4 years ago

It'd be nice if @sdementen were to make me (or anyone else interested) a maintainer so these type things could be resolved.

sdementen commented 4 years ago

@gregwalters with pleasure! I find my way to make you maintainer with me on the project

sdementen commented 4 years ago

maybe worthwile to sync the version of piecash with the version of gnucash (at least on major versions) so we could release packages that support a specific version without needing to make the package multi-version compatible (which is kind of hard given the sqlalchemy models)

sdementen commented 4 years ago

@gregwalters I have invited you to collaborate on the project (I am not expert in github access mgt so if I should do something else to give you maintainer role, tell me!)

sdementen commented 4 years ago

@gregwalters I see you are now a collaborator. Do you have enough rights?

gregwalters commented 4 years ago

Hey @sdementen,

Thanks for taking such quick action on my behalf! I regret I've not been able to reciprocate due to a busy personal schedule. Some time in the next couple of days I plan on taking an in-depth look to confirm.

gregwalters commented 4 years ago

Hey @sdementen, can you make me a maintainer on pypi too? Username allrightname.

sdementen commented 4 years ago

Hi @gregwalters if I recall correctly (but really not sure), the pypi deployment is done via travisCI once merged into master

sdementen commented 4 years ago

@gregwalters when merging a branch, we should ensure that, beyond the code:

sdementen commented 4 years ago

@gregwalters I am also on gitter (https://gitter.im/sdementen/piecash) if you want to chat online

sdementen commented 4 years ago

@gregwalters @EuPhobos could you try the new release of piecash 1.1 and confirm (or not) the issue is fixed ?

gregwalters commented 4 years ago

Just tested with the latest and the issue is resolved.