frappe / erpnext_shopify

[Deprecated] Shopify connector for ERPNext
https://frappe.github.io/erpnext_shopify
Other
23 stars 56 forks source link

Error On Sync - Unable to Create Customer and Get Customer Address from Shopify #137

Open addymuliady opened 7 years ago

addymuliady commented 7 years ago

Error on sync:

Traceback (most recent call last):
  File "/home/ubuntu/frappe-bench/apps/erpnext_shopify/erpnext_shopify/sync_customers.py", line 42, in create_customer
    create_customer_address(customer, shopify_customer)
  File "/home/ubuntu/frappe-bench/apps/erpnext_shopify/erpnext_shopify/sync_customers.py", line 55, in create_customer_address
    for i, address in enumerate(shopify_customer.get("addresses")):
TypeError: 'NoneType' object is not iterable
OtterCode commented 7 years ago

Don't know if this is related, but I'm getting customer errors too. Here's the Shopify log for
sync_erpnext_customers.

  File "/home/ubuntu/frappe-bench/apps/erpnext_shopify/erpnext_shopify/sync_customers.py", line 107, in sync_erpnext_customers
    update_customer_to_shopify(customer, last_sync_condition)
  File "/home/ubuntu/frappe-bench/apps/erpnext_shopify/erpnext_shopify/sync_customers.py", line 151, in update_customer_to_shopify
    update_address_details(customer, last_sync_condition)
  File "/home/ubuntu/frappe-bench/apps/erpnext_shopify/erpnext_shopify/sync_customers.py", line 164, in update_address_details
    customer_addresses = get_customer_addresses(customer, last_sync_condition)
  File "/home/ubuntu/frappe-bench/apps/erpnext_shopify/erpnext_shopify/sync_customers.py", line 190, in get_customer_addresses
    return frappe.db.sql(address_query, as_dict=1)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/database.py", line 149, in sql
    self._cursor.execute(query)
  File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/cursors.py", line 205, in execute
    self.errorhandler(self, exc, value)
  File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
OperationalError: (1054, "Unknown column 'addr.customer' in 'where clause'")

And the request:

{"shopify_customer_id": "5535835588", "name": "Angel Marchena", "customer_name": "Angel Marchena "}
OtterCode commented 7 years ago

The above error is what occurs when I've already got the customer in my database. If they aren't already there, the address import just fails silently.