Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue using the Sync WooCommerce #71

Open
vithusel opened this issue Mar 28, 2023 · 3 comments
Open

Issue using the Sync WooCommerce #71

vithusel opened this issue Mar 28, 2023 · 3 comments

Comments

@vithusel
Copy link

Logs show the below error when running the sync function

Traceback (most recent call last):
File "apps/woocommerceconnector/woocommerceconnector/sync_orders.py", line 30, in sync_woocommerce_orders
create_order(woocommerce_order, woocommerce_settings)
File "apps/woocommerceconnector/woocommerceconnector/sync_orders.py", line 164, in create_order
so = create_sales_order(woocommerce_order, woocommerce_settings, company)
File "apps/woocommerceconnector/woocommerceconnector/sync_orders.py", line 211, in create_sales_order
"taxes": get_order_taxes(woocommerce_order, woocommerce_settings),
File "apps/woocommerceconnector/woocommerceconnector/sync_orders.py", line 360, in get_order_taxes
"account_head": get_tax_account_head(woocommerce_tax),
File "apps/woocommerceconnector/woocommerceconnector/sync_orders.py", line 424, in get_tax_account_head
tax_account = frappe.db.get_value("woocommerce Tax Account",
File "apps/frappe/frappe/database/database.py", line 495, in get_value
result = self.get_values(
File "apps/frappe/frappe/database/database.py", line 592, in get_values
out = self._get_values_from_table(
File "apps/frappe/frappe/database/database.py", line 822, in _get_values_from_table
return self.sql(query, as_dict=as_dict, debug=debug, update=update, run=run, pluck=pluck)
File "apps/frappe/frappe/database/database.py", line 218, in sql
self._cursor.execute(query, values)
File "env/lib/python3.10/site-packages/pymysql/cursors.py", line 148, in execute
result = self._query(query)
File "env/lib/python3.10/site-packages/pymysql/cursors.py", line 310, in _query
conn.query(q)
File "env/lib/python3.10/site-packages/pymysql/connections.py", line 548, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File "env/lib/python3.10/site-packages/pymysql/connections.py", line 775, in _read_query_result
result.read()
File "env/lib/python3.10/site-packages/pymysql/connections.py", line 1156, in read
first_packet = self.connection._read_packet()
File "env/lib/python3.10/site-packages/pymysql/connections.py", line 725, in _read_packet
packet.raise_for_error()
File "env/lib/python3.10/site-packages/pymysql/protocol.py", line 221, in raise_for_error
err.raise_mysql_exception(self._data)
File "env/lib/python3.10/site-packages/pymysql/err.py", line 143, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'b'Tax' ORDER BY modified DESC LIMIT 1' at line 1")

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "apps/woocommerceconnector/woocommerceconnector/api.py", line 52, in sync_woocommerce_resources
sync_orders()
File "apps/woocommerceconnector/woocommerceconnector/sync_orders.py", line 15, in sync_orders
sync_woocommerce_orders()
File "apps/woocommerceconnector/woocommerceconnector/sync_orders.py", line 37, in sync_woocommerce_orders
if e.args and e.args[0] and e.args[0].decode("utf-8").startswith("402"):
AttributeError: 'int' object has no attribute 'decode'

@vithusel
Copy link
Author

vithusel commented Apr 2, 2023

Willing to pay to get this fixed as its the only block for me being able to sync.

Setup a new instance of ERPNext and the issue is still happening.

@sptechcue
Copy link

You must delete .decode("utf-8") in sync_orders.py

@drzewkopl
Copy link

Fixed in this repo: https://github.com/drzewkopl/WooCommerceConnector

Settings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants