libracore / WooCommerceConnector

Integration App for ERPNext to connect to WooCommerce
Other
81 stars 136 forks source link

Sync error #54

Closed amr3k closed 2 years ago

amr3k commented 2 years ago

I've configured it correctly but there's an error after clicking Sync woocommerce

Here's part of the log file

Traceback (most recent call last):
  File "/srv/www/frappe-bench/apps/woocommerceconnector/woocommerceconnector/sync_products.py", line 30, in sync_woocommerce_items
    make_item(warehouse, woocommerce_item, woocommerce_item_list)
  File "/srv/www/frappe-bench/apps/woocommerceconnector/woocommerceconnector/sync_products.py", line 50, in make_item
    create_item(woocommerce_item, warehouse, 1, attributes=attributes, woocommerce_item_list=woocommerce_item_list)
  File "/srv/www/frappe-bench/apps/woocommerceconnector/woocommerceconnector/sync_products.py", line 108, in create_item
    if not is_item_exists(item_dict, attributes, variant_of=variant_of, woocommerce_item_list=woocommerce_item_list):
  File "/srv/www/frappe-bench/apps/woocommerceconnector/woocommerceconnector/sync_products.py", line 231, in is_item_exists
    erp_item_match = frappe.get_all("Item",
  File "/srv/www/frappe-bench/apps/frappe/frappe/__init__.py", line 1473, in get_all
    return get_list(doctype, *args, **kwargs)
  File "/srv/www/frappe-bench/apps/frappe/frappe/__init__.py", line 1446, in get_list
    return frappe.model.db_query.DatabaseQuery(doctype).execute(*args, **kwargs)
  File "/srv/www/frappe-bench/apps/frappe/frappe/model/db_query.py", line 106, in execute
    result = self.build_and_run()
  File "/srv/www/frappe-bench/apps/frappe/frappe/model/db_query.py", line 138, in build_and_run
    return frappe.db.sql(query, as_dict=not self.as_list, debug=self.debug,
  File "/srv/www/frappe-bench/apps/frappe/frappe/database/database.py", line 155, in sql
    self._cursor.execute(query)
  File "/srv/www/frappe-bench/env/lib/python3.9/site-packages/pymysql/cursors.py", line 148, in execute
    result = self._query(query)
  File "/srv/www/frappe-bench/env/lib/python3.9/site-packages/pymysql/cursors.py", line 310, in _query
    conn.query(q)
  File "/srv/www/frappe-bench/env/lib/python3.9/site-packages/pymysql/connections.py", line 548, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
  File "/srv/www/frappe-bench/env/lib/python3.9/site-packages/pymysql/connections.py", line 775, in _read_query_result
    result.read()
  File "/srv/www/frappe-bench/env/lib/python3.9/site-packages/pymysql/connections.py", line 1156, in read
    first_packet = self.connection._read_packet()
  File "/srv/www/frappe-bench/env/lib/python3.9/site-packages/pymysql/connections.py", line 725, in _read_packet
    packet.raise_for_error()
  File "/srv/www/frappe-bench/env/lib/python3.9/site-packages/pymysql/protocol.py", line 221, in raise_for_error
    err.raise_mysql_exception(self._data)
  File "/srv/www/frappe-bench/env/lib/python3.9/site-packages/pymysql/err.py", line 143, in raise_mysql_exception
    raise errorclass(errno, errval)
pymysql.err.OperationalError: (1054, "Unknown column 'tabItem.woocommerce_product_id' in 'where clause'")

The other part it a json content including actual products data from my woocommerce website, So I guess the integration went successful but there's a programming error in SQL

bynicolas commented 2 years ago

Same, trying to understand the issue here

lasalesi commented 2 years ago

The error indicates that your database is missing the Item:woocommerce_product_id

Has there been an issue in the installation?

bench migrate

Which version of ERPNExt are you using?

amr3k commented 2 years ago

Has there been an issue in the installation?

No there was no issue during installation as far as I remember.

Which version of ERPNext are you using?

I was using v13.

Sorry I can't contribute much because I moved away from ERPNext as I found it taking too much time on configuration and fixing bugs.

Thanks for your work on this plugin though :)