dvdl16 / woocommerce_fusion

WooCommerce connector for ERPNext v15
https://finfoot.tech
Other
19 stars 17 forks source link

AttributeError: 'dict' object has no attribute 'name' #88

Closed thomasoceguera closed 2 months ago

thomasoceguera commented 3 months ago

Current Behavior

When attempting to sync orders to ERP from woocommerce orders list, an error pops up. Copying the error to the clipboard reveals.

App Versions

{
    "chat": "0.0.1",
    "erpnext": "15.23.0",
    "frappe": "15.26.0",
    "hrms": "15.20.3",
    "payments": "0.0.1",
    "persona": "0.0.1",
    "woocommerce_fusion": "1.5.4"
}

Route

Form/WooCommerce Order/recharge.health~64079

Traceback

Traceback (most recent call last):
  File "apps/frappe/frappe/app.py", line 110, in application
    response = frappe.api.handle(request)
  File "apps/frappe/frappe/api/__init__.py", line 49, in handle
    data = endpoint(**arguments)
  File "apps/frappe/frappe/api/v1.py", line 36, in handle_rpc_call
    return frappe.handler.handle()
  File "apps/frappe/frappe/handler.py", line 49, in handle
    data = execute_cmd(cmd)
  File "apps/frappe/frappe/handler.py", line 85, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "apps/frappe/frappe/__init__.py", line 1768, in call
    return fn(*args, **newargs)
  File "apps/frappe/frappe/utils/typing_validations.py", line 31, in wrapper
    return func(*args, **kwargs)
  File "apps/woocommerce_fusion/woocommerce_fusion/tasks/sync_sales_orders.py", line 50, in run_sales_orders_sync
    sync.run()
  File "apps/woocommerce_fusion/woocommerce_fusion/tasks/sync_sales_orders.py", line 97, in run
    self.get_woocommerce_orders_modified_since()
  File "apps/woocommerce_fusion/woocommerce_fusion/tasks/sync_sales_orders.py", line 110, in get_woocommerce_orders_modified_since
    self.get_list_of_wc_orders(
  File "apps/woocommerce_fusion/woocommerce_fusion/tasks/sync_sales_orders.py", line 242, in get_list_of_wc_orders
    self.wc_orders_dict[wc_order.name] = wc_order
AttributeError: 'dict' object has no attribute 'name'

Request Data

{
    "type": "POST",
    "args": {},
    "headers": {},
    "error_handlers": {},
    "url": "/api/method/woocommerce_fusion.tasks.sync_sales_orders.run_sales_orders_sync",
    "request_id": "010f3d38-6e85-4d74-8bf6-aa998e29bf79"
}

Response Data

{
    "exception": "AttributeError: 'dict' object has no attribute 'name'",
    "exc_type": "AttributeError",
    "_exc_source": "woocommerce_fusion (app)"
}

Steps To Reproduce

Open woocommerce orders > select an order > Actions > Sync to ERP

Expected Behavior

sync orders and customers to ERP Sales orders

Anything else?

No response

Environment and Versions

"chat": "0.0.1",
    "erpnext": "15.23.0",
    "frappe": "15.26.0",
    "hrms": "15.20.3",
    "payments": "0.0.1",
    "persona": "0.0.1",
    "woocommerce_fusion": "1.5.4"

Operating System

MacOS

What browsers are you seeing the problem on?

Chrome

dvdl16 commented 3 months ago

Thanks @thomasoceguera . Do you have any records in Error Log corresponding with this timestamp? I'm having difficulty replicating this issue

thomasoceguera commented 2 months ago

sorry I didnt see this until today. Been on vacation. Did it get resolved?

dvdl16 commented 2 months ago

Please try with v1.7.1