Woocommerce connector

Hi All,

I have installed the libracore woocommerce connecter but when i try to sync, it fails with the below trace.

Traceback (most recent call last):
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 225, in create_sales_order
File “apps/frappe/frappe/model/document.py”, line 287, in save
return self._save(*args, **kwargs)
File “apps/frappe/frappe/model/document.py”, line 309, in save
return self.insert()
File “apps/frappe/frappe/model/document.py”, line 240, in insert
File “apps/frappe/frappe/model/document.py”, line 971, in run_before_save_methods
File “apps/frappe/frappe/model/document.py”, line 869, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “apps/frappe/frappe/model/document.py”, line 1161, in composer
return composed(self, method, *args, **kwargs)
File “apps/frappe/frappe/model/document.py”, line 1144, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “apps/frappe/frappe/model/document.py”, line 866, in fn
return method_object(*args, **kwargs)
File “apps/erpnext/erpnext/selling/doctype/sales_order/sales_order.py”, line 42, in validate
super(SalesOrder, self).validate()
File “apps/erpnext/erpnext/controllers/selling_controller.py”, line 30, in validate
super(SellingController, self).validate()
File “apps/erpnext/erpnext/controllers/stock_controller.py”, line 30, in validate
super(StockController, self).validate()
File “apps/erpnext/erpnext/controllers/accounts_controller.py”, line 141, in validate
File “apps/erpnext/erpnext/controllers/accounts_controller.py”, line 213, in validate_all_documents_schedule
File “apps/erpnext/erpnext/controllers/accounts_controller.py”, line 206, in validate_non_invoice_documents_schedule
File “apps/erpnext/erpnext/controllers/accounts_controller.py”, line 1356, in validate_payment_schedule_dates
(“Row {0}: Due Date in the Payment Terms table cannot be before Posting Date”).format(d.idx))
File “apps/frappe/frappe/init.py”, line 444, in throw
msgprint(msg, raise_exception=exc, title=title, indicator=‘red’, is_minimizable=is_minimizable, wide=wide, as_list=as_list)
File “apps/frappe/frappe/init.py”, line 423, in msgprint
File “apps/frappe/frappe/init.py”, line 378, in _raise_exception
raise raise_exception(msg)
frappe.exceptions.ValidationError: Row 1: Due Date in the Payment Terms table cannot be before Posting Date

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “apps/woocommerceconnector/woocommerceconnector/api.py”, line 52, in sync_woocommerce_resources
File “apps/woocommerceconnector/woocommerceconnector/sync_orders.py”, line 15, in sync_orders
File “apps/woocommerceconnector/woocommerceconnector/sync_orders.py”, line 37, in sync_woocommerce_orders
if e.args and e.args[0] and e.args[0].decode(“utf-8”).startswith(“402”):
AttributeError: ‘str’ object has no attribute ‘decode’

I originally thought it was due to the time being out on the two servers, but this has now been synchronized and i still get this error. Any ideas please?

did you find a solution? same problem here 4 years later with this app

We also faced another issue on a WooCommerce site. On another site there is no issue. We worked out the code to realise it’s not from app side. It’s from WooCommerce website. Check there and you may find a solution.

sorry, didn’t really get, where I could look, and which site/side can be fixed (especially how).

But I think I found there is an issue in the woocommerceconnector, as there is no “posting_date” in ERPNext’s Sales Order. Its name is “transaction_date”, even if the error message calls it “Posting Date”

So I changed that for me and now it works:

We’re on a “vanilla” erpnext v13 installation with a basic woocommerce installation. So perhaps this was correct another time; I don’t know.

Perhaps it helps someone else.

1 Like

It’s not tested on V13. Works fine on V11 and V12.

Maybe the developer @lasalesi would know or have an idea.

Woocommerce synchronization is 100% functional in v13.