sdementen / piecash

Pythonic interface to GnuCash SQL documents
Other
289 stars 74 forks source link

gnucash 3.10 Unsupported #134

Closed kerwinxu closed 4 years ago

kerwinxu commented 4 years ago

ValueError Traceback (most recent call last)

in 4 db_name='gnucash', 5 db_host='localhost', ----> 6 db_port=3306) d:\Anaconda3\lib\site-packages\piecash\core\session.py in open_book(sqlite_file, uri_conn, readonly, open_if_lock, do_backup, db_type, db_user, db_password, db_name, db_host, db_port, check_same_thread, **kwargs) 348 break 349 else: --> 350 raise ValueError("Unsupported table versions") 351 assert version == "3.0", "This version of piecash only support books from gnucash 3.0.x " \ 352 "which is not the case for {}".format(uri_conn) ValueError: Unsupported table versions
jeo1 commented 4 years ago

Try replacing version_supported in \piecash\core\session.py with the following:

version_supported = {
    "2.6": {
        "Gnucash": 2062100,
        "Gnucash-Resave": 19920,
        "accounts": 1,
        "billterms": 2,
        "books": 1,
        "budget_amounts": 1,
        "budgets": 1,
        "commodities": 1,
        "customers": 2,
        "employees": 2,
        "entries": 3,
        "invoices": 3,
        "jobs": 1,
        "lots": 2,
        "orders": 1,
        "prices": 2,
        "recurrences": 2,
        "schedxactions": 1,
        "slots": 3,
        "splits": 4,
        "taxtable_entries": 3,
        "taxtables": 2,
        "transactions": 3,
        "vendors": 1,
    },
    "3.0": {
        "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,
    },
}
obbardc commented 4 years ago

see PR #135

kerwinxu commented 4 years ago

Try replacing version_supported in \piecash\core\session.py with the following:

version_supported = {
    "2.6": {
        "Gnucash": 2062100,
        "Gnucash-Resave": 19920,
        "accounts": 1,
        "billterms": 2,
        "books": 1,
        "budget_amounts": 1,
        "budgets": 1,
        "commodities": 1,
        "customers": 2,
        "employees": 2,
        "entries": 3,
        "invoices": 3,
        "jobs": 1,
        "lots": 2,
        "orders": 1,
        "prices": 2,
        "recurrences": 2,
        "schedxactions": 1,
        "slots": 3,
        "splits": 4,
        "taxtable_entries": 3,
        "taxtables": 2,
        "transactions": 3,
        "vendors": 1,
    },
    "3.0": {
        "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,
    },
}

Thank you , it work .