Skip to content

TypeError: 'InvalidPhoneNumberError' object is not subscriptable #75

@solaress

Description

@solaress

I believe this plugin is amazing work, i have successfully imported products and customers but having error on importing orders from woo to erpnext. As i understood some issue with prone numbers, some customers use + or "( )" or space, i believe it causes the error, can you please have a look ?
Thank you

Traceback (most recent call last):
File "apps/woocommerceconnector/woocommerceconnector/sync_customers.py", line 153, in create_customer_contact
}).insert()
File "apps/frappe/frappe/model/document.py", line 260, in insert
self._validate()
File "apps/frappe/frappe/model/document.py", line 529, in _validate
self._validate_data_fields()
File "apps/frappe/frappe/model/base_document.py", line 859, in _validate_data_fields
frappe.utils.validate_phone_number(data, throw=True)
File "apps/frappe/frappe/utils/init.py", line 129, in validate_phone_number
frappe.throw(
File "apps/frappe/frappe/init.py", line 525, in throw
msgprint(
File "apps/frappe/frappe/init.py", line 493, in msgprint
_raise_exception()
File "apps/frappe/frappe/init.py", line 442, in _raise_exception
raise raise_exception(msg)
frappe.exceptions.InvalidPhoneNumberError: '+19567844735 is not a valid Phone Number

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "apps/woocommerceconnector/woocommerceconnector/sync_customers.py", line 60, in create_customer
create_customer_contact(customer, woocommerce_customer)
File "apps/woocommerceconnector/woocommerceconnector/sync_customers.py", line 156, in create_customer_contact
make_woocommerce_log(title=e, status="Error", method="create_customer_contact", message=frappe.get_traceback(),
File "apps/woocommerceconnector/woocommerceconnector/utils.py", line 54, in make_woocommerce_log
log.title = title[0:140]
TypeError: 'InvalidPhoneNumberError' object is not subscriptable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "apps/woocommerceconnector/woocommerceconnector/api.py", line 51, in sync_woocommerce_resources
sync_customers()
File "apps/woocommerceconnector/woocommerceconnector/sync_customers.py", line 10, in sync_customers
sync_woocommerce_customers(woocommerce_customer_list)
File "apps/woocommerceconnector/woocommerceconnector/sync_customers.py", line 19, in sync_woocommerce_customers
create_customer(woocommerce_customer, woocommerce_customer_list)
File "apps/woocommerceconnector/woocommerceconnector/sync_customers.py", line 71, in create_customer
make_woocommerce_log(title=e, status="Error", method="create_customer", message=frappe.get_traceback(),
File "apps/woocommerceconnector/woocommerceconnector/utils.py", line 54, in make_woocommerce_log
log.title = title[0:140]
TypeError: 'TypeError' object is not subscriptable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions