libracore / WooCommerceConnector

Integration App for ERPNext to connect to WooCommerce
Other
88 stars 149 forks source link

Not able to sync woocommerce orders #76

Open TubaApollo opened 1 year ago

TubaApollo commented 1 year ago

Could be related to #71, but i am not sure. The second error was fixed with the message from @sptechcue, . As soon as i try to sync with woocommerce i get this error:

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 38, in sync_woocommerce_orders
    raise e
  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 378, in get_order_taxes
    taxes = update_taxes_with_shipping_lines(taxes, woocommerce_order.get("shipping_lines"), woocommerce_settings)
  File "apps/woocommerceconnector/woocommerceconnector/sync_orders.py", line 399, in update_taxes_with_shipping_lines
    "account_head": get_shipping_account_head(shipping_charge),
  File "apps/woocommerceconnector/woocommerceconnector/sync_orders.py", line 412, in get_shipping_account_head
    shipping_account =  frappe.db.get_value("woocommerce Tax Account", \
  File "apps/frappe/frappe/database/database.py", line 496, in get_value
    result = self.get_values(
  File "apps/frappe/frappe/database/database.py", line 593, in get_values
    out = self._get_values_from_table(
  File "apps/frappe/frappe/database/database.py", line 823, in _get_values_from_table
    return query.run(as_dict=as_dict, debug=debug, update=update, run=run, pluck=pluck)
  File "apps/frappe/frappe/query_builder/utils.py", line 76, in execute_query
    return frappe.db.sql(query, params, *args, **kwargs)  # nosemgrep
  File "apps/frappe/frappe/database/database.py", line 219, in sql
    self._cursor.execute(query, values)
  File "env/lib/python3.10/site-packages/pymysql/cursors.py", line 158, in execute
    result = self._query(query)
  File "env/lib/python3.10/site-packages/pymysql/cursors.py", line 325, in _query
    conn.query(q)
  File "env/lib/python3.10/site-packages/pymysql/connections.py", line 549, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
  File "env/lib/python3.10/site-packages/pymysql/connections.py", line 779, in _read_query_result
    result.read()
  File "env/lib/python3.10/site-packages/pymysql/connections.py", line 1157, in read
    first_packet = self.connection._read_packet()
  File "env/lib/python3.10/site-packages/pymysql/connections.py", line 729, 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'Flat rate' ORDER BY `modified` DESC LIMIT 1' at line 1")

I am using MariaDB 10.9.5, could it have something to do with the new MariaDB Version?

Syncing WooCommerce IDs works fine..

Thanks 😅

drzewkopl commented 9 months ago

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

Settings

TubaApollo commented 9 months ago

Great, thanks a lot!