Is there a recommended ERPNext version for the WooCommerceConnector from Libracore?

I’ve been spinning my wheels getting the integration working. Invariably when it comes to syncing orders, it throws an error about due date can’t be before posting date. This is an initial sync from a running WooCommerce store where the orders are from a few days ago.

Anyone got this working and can share some tips?

1 Like

You could try inserting the data in the DB using a function which disables these checks.
Just find them in the document API documentation for frappe framework.



Serialize and insert a document into database. Warning: This bypasses all validations and controller methods that might be required to run before and after inserting.

This is the full text of the error it’s throwing:

Traceback (most recent call last):
File “apps/woocommerceconnector/woocommerceconnector/”, line 30, in sync_woocommerce_orders
create_order(woocommerce_order, woocommerce_settings)
File “apps/woocommerceconnector/woocommerceconnector/”, line 164, in create_order
so = create_sales_order(woocommerce_order, woocommerce_settings, company)
File “apps/woocommerceconnector/woocommerceconnector/”, line 225, in create_sales_order
File “apps/frappe/frappe/model/”, line 310, in save
return self._save(*args, **kwargs)
File “apps/frappe/frappe/model/”, line 332, in _save
return self.insert()
File “apps/frappe/frappe/model/”, line 261, in insert
File “apps/frappe/frappe/model/”, line 1052, in run_before_save_methods
File “apps/frappe/frappe/model/”, line 941, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “apps/frappe/frappe/model/”, line 1259, in composer
return composed(self, method, *args, **kwargs)
File “apps/frappe/frappe/model/”, line 1241, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “apps/frappe/frappe/model/”, line 938, in fn
return method_object(*args, **kwargs)
File “apps/erpnext/erpnext/selling/doctype/sales_order/”, line 44, in validate
super(SalesOrder, self).validate()
File “apps/erpnext/erpnext/controllers/”, line 32, in validate
super(SellingController, self).validate()
File “apps/erpnext/erpnext/controllers/”, line 38, in validate
super(StockController, self).validate()
File “apps/erpnext/erpnext/controllers/”, line 166, in validate
File “apps/erpnext/erpnext/controllers/”, line 272, in validate_all_documents_schedule
File “apps/erpnext/erpnext/controllers/”, line 265, in validate_non_invoice_documents_schedule
File “apps/erpnext/erpnext/controllers/”, line 1684, in validate_payment_schedule_dates
File “apps/frappe/frappe/”, line 504, in throw
File “apps/frappe/frappe/”, line 479, in msgprint
File “apps/frappe/frappe/”, line 434, 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/”, line 52, in sync_woocommerce_resources
File “apps/woocommerceconnector/woocommerceconnector/”, line 15, in sync_orders
File “apps/woocommerceconnector/woocommerceconnector/”, 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’

1 Like

So I sorted this out, and it’s not a source code issue. It’s an undocumented ERPNext configuration requirement issue.

In case anyone ever comes across this via Google:

  1. You need to create a Payment Term Template. Name it whatever you want, but make it something easy. Set it for Days after Invoice Date, 100%, and whatever number you feel is apporpriate. Checkmark the Allocate Payment Based on Payment Terms checkbox. If you need different settings, it’s up to you to test and determine appropriate settings based on desired behavior. I did 100%, 7 days.
  2. Customize the Sales Order form, go to page 3, edit the Payment Terms Template, drop the name of your template into the Default box, click out then Update.
1 Like

The woocommerce connector of libracore works 100% both in individual products and with variants in ERPNExt version 14, you have to fix the errors that occur, but it works, orders, products and customers are synchronized and depending on your configuration even the sales invoice makes it and the payment if you use Stripe registers it.