WooCommerce variable products

Hi,

On WooCommerce I have products with variants (variable product). But when it sync on ErpNext for Sale Order, it doesn’t take into account the variant. Is there a way to make it works?

Thank you.

What sync are you using ?

I am using the ERPNext WooCommerce integration.

Have asked this on another thread but am interested to know if a sales invoice is created in ERPNext or just sales order? If sales invoice then is a payment entry is recorded in ERPNext? Adding items to WooCommerce warehouse in ERPNext increases stock on website? Is tax correctly passed to ledger.

What other fields are synchronised? Any particular theme recommendations that works fine? Thank you.

@Muzzy only sales orders are created with the standard woocommerce integration and no, sales invoices or payment entries are not created if/when payment is completed on the woocommerce/ecommerce site.

To your second question, there’s no 2-way sync for stocks. The source of truth for stocks is woocommerce and it does not take into account stock values in ERPNext before creating sales orders either. What’s worse, woocommerce tends to create it’s own items when syncing sales orders to ERPNext so even if you already have the item created in ERPNext woocommerce ignores it and creates its own.

The woocommerce connector developed by @lasalesi discussed in this thread is promising but so far i haven’t seen anyone who has got it to work. I have tested it extensively but i can’t seem to get it to sync stock to woocommerce and there isn’t much answer why.

1 Like

@lasalesi

Over to you once again

Thanks @olamide_shodunke :wink:

Just updated the connector setup function (for the req Py2 issue)…

Have this been solved yet? I am still having the same issue in version 13 now.

@prasanvadassery

Try this. It is a fork of the original with some code updates. Working fine on our instance.

@Muzzy

Thanks for the update. I will certainly check that.

I have a quick question though. I had setup the default ERPNext woocommerce integration and it’s syncing the sales orders, customers, addresses and the items. But I am having a strange problem of the product variants from woocommerce not syncing to the item variants in ERPNext? The integration is still fetching the product Id from woocommerce rather than the variant id and hence the product variants are not recognised as new items to ERPNext. Anything I have to additional setup or is it a bug with the integration. Kindly provide your inputs.

Hi. Havent tried that yet. Maybe @lasalesi would know as he had made the app. We just fixed some issue to get it working.

If you mean “default ERPNext woocommerce integration” for the included version, that only has a limited scope. The WooCommerceConnector (in either original or Muzzy’s version) should sync variants without issues. Check the woocommerce_id and woocommerce_variant_id fields in the Item doctype…

Thanks @lasalesi @Muzzy. Will check and come back to you on this.

Can we install this app on the ERPNext cloud account? If so, what will be the steps?

I am getting an error while setting up woocommerce config

Can you please me know why this is coming?

@lasalesi, Kindly check…

Looks like V13 is being used. We haven’t yet tested on V13. It works fine on V11 and V12.

Yes the version is v13. Can you please look into this?

Could you please share the browser console trace (typically when hitting F12)?

@lasalesi Please find the trace below

Using this console may allow attackers to impersonate you and steal your information. Do not enter or paste code that you do not understand.
/api/method/frappe.desk.form.save.savedocs:1 Failed to load resource: the server responded with a status of 500 (INTERNAL SERVER ERROR)
desk.min.js?ver=1623046916.0:sourcemap:1 Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/save.py”, line 21, in savedocs
doc.save()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 284, in save
return self._save(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 319, in _save
self.run_before_save_methods()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 960, in run_before_save_methods
self.run_method(“validate”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 858, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 1147, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 1130, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 852, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/woocommerceconnector/woocommerceconnector/woocommerceconnector/doctype/woocommerce_config/woocommerce_config.py”, line 17, in validate
self.validate_access()
File “/home/frappe/frappe-bench/apps/woocommerceconnector/woocommerceconnector/woocommerceconnector/doctype/woocommerce_config/woocommerce_config.py”, line 26, in validate_access
r = get_request(‘settings’, {“api_key”: self.api_key,
File “/home/frappe/frappe-bench/apps/woocommerceconnector/woocommerceconnector/woocommerce_requests.py”, line 61, in get_request
return get_request_request(path, settings).json()
File “/home/frappe/frappe-bench/apps/woocommerceconnector/woocommerceconnector/woocommerce_requests.py”, line 55, in get_request_request
message=“{0}: {1}”.format(r.url, r.json()),
File “/home/frappe/frappe-bench/env/lib/python3.8/site-packages/requests/models.py”, line 900, in json
return complexjson.loads(self.text, **kwargs)
File “/usr/lib/python3.8/json/init.py”, line 357, in loads
return _default_decoder.decode(s)
File “/usr/lib/python3.8/json/decoder.py”, line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File “/usr/lib/python3.8/json/decoder.py”, line 355, in raw_decode
raise JSONDecodeError(“Expecting value”, s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

desk.min.js?ver=1623046916.0:sourcemap:1 Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/app.py”, line 68, in application
response = frappe.api.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/api.py”, line 54, in handle
return frappe.handler.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 31, in handle
data = execute_cmd(cmd)
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 67, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1169, in call
return fn(*args, **newargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/save.py”, line 21, in savedocs
doc.save()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 284, in save
return self._save(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 319, in _save
self.run_before_save_methods()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 960, in run_before_save_methods
self.run_method(“validate”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 858, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 1147, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 1130, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 852, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/woocommerceconnector/woocommerceconnector/woocommerceconnector/doctype/woocommerce_config/woocommerce_config.py”, line 17, in validate
self.validate_access()
File “/home/frappe/frappe-bench/apps/woocommerceconnector/woocommerceconnector/woocommerceconnector/doctype/woocommerce_config/woocommerce_config.py”, line 26, in validate_access
r = get_request(‘settings’, {“api_key”: self.api_key,
File “/home/frappe/frappe-bench/apps/woocommerceconnector/woocommerceconnector/woocommerce_requests.py”, line 61, in get_request
return get_request_request(path, settings).json()
File “/home/frappe/frappe-bench/apps/woocommerceconnector/woocommerceconnector/woocommerce_requests.py”, line 55, in get_request_request
message=“{0}: {1}”.format(r.url, r.json()),
File “/home/frappe/frappe-bench/env/lib/python3.8/site-packages/requests/models.py”, line 900, in json
return complexjson.loads(self.text, **kwargs)
File “/usr/lib/python3.8/json/init.py”, line 357, in loads
return _default_decoder.decode(s)
File “/usr/lib/python3.8/json/decoder.py”, line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File “/usr/lib/python3.8/json/decoder.py”, line 355, in raw_decode
raise JSONDecodeError(“Expecting value”, s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

/api/method/frappe.desk.form.save.savedocs:1 Failed to load resource: the server responded with a status of 500 (INTERNAL SERVER ERROR)
desk.min.js?ver=1623046916.0:sourcemap:1 Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/save.py”, line 21, in savedocs
doc.save()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 284, in save
return self._save(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 319, in _save
self.run_before_save_methods()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 960, in run_before_save_methods
self.run_method(“validate”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 858, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 1147, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 1130, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 852, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/woocommerceconnector/woocommerceconnector/woocommerceconnector/doctype/woocommerce_config/woocommerce_config.py”, line 17, in validate
self.validate_access()
File “/home/frappe/frappe-bench/apps/woocommerceconnector/woocommerceconnector/woocommerceconnector/doctype/woocommerce_config/woocommerce_config.py”, line 26, in validate_access
r = get_request(‘settings’, {“api_key”: self.api_key,
File “/home/frappe/frappe-bench/apps/woocommerceconnector/woocommerceconnector/woocommerce_requests.py”, line 61, in get_request
return get_request_request(path, settings).json()
File “/home/frappe/frappe-bench/apps/woocommerceconnector/woocommerceconnector/woocommerce_requests.py”, line 55, in get_request_request
message=“{0}: {1}”.format(r.url, r.json()),
File “/home/frappe/frappe-bench/env/lib/python3.8/site-packages/requests/models.py”, line 900, in json
return complexjson.loads(self.text, **kwargs)
File “/usr/lib/python3.8/json/init.py”, line 357, in loads
return _default_decoder.decode(s)
File “/usr/lib/python3.8/json/decoder.py”, line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File “/usr/lib/python3.8/json/decoder.py”, line 355, in raw_decode
raise JSONDecodeError(“Expecting value”, s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

desk.min.js?ver=1623046916.0:sourcemap:1 Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/app.py”, line 68, in application
response = frappe.api.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/api.py”, line 54, in handle
return frappe.handler.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 31, in handle
data = execute_cmd(cmd)
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 67, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1169, in call
return fn(*args, **newargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/save.py”, line 21, in savedocs
doc.save()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 284, in save
return self._save(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 319, in _save
self.run_before_save_methods()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 960, in run_before_save_methods
self.run_method(“validate”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 858, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 1147, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 1130, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 852, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/woocommerceconnector/woocommerceconnector/woocommerceconnector/doctype/woocommerce_config/woocommerce_config.py”, line 17, in validate
self.validate_access()
File “/home/frappe/frappe-bench/apps/woocommerceconnector/woocommerceconnector/woocommerceconnector/doctype/woocommerce_config/woocommerce_config.py”, line 26, in validate_access
r = get_request(‘settings’, {“api_key”: self.api_key,
File “/home/frappe/frappe-bench/apps/woocommerceconnector/woocommerceconnector/woocommerce_requests.py”, line 61, in get_request
return get_request_request(path, settings).json()
File “/home/frappe/frappe-bench/apps/woocommerceconnector/woocommerceconnector/woocommerce_requests.py”, line 55, in get_request_request
message=“{0}: {1}”.format(r.url, r.json()),
File “/home/frappe/frappe-bench/env/lib/python3.8/site-packages/requests/models.py”, line 900, in json
return complexjson.loads(self.text, **kwargs)
File “/usr/lib/python3.8/json/init.py”, line 357, in loads
return _default_decoder.decode(s)
File “/usr/lib/python3.8/json/decoder.py”, line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File “/usr/lib/python3.8/json/decoder.py”, line 355, in raw_decode
raise JSONDecodeError(“Expecting value”, s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

DevTools failed to load source map: Could not load content for webpack://Quill/node_modules/quill-delta/dist/Delta.js.map: HTTP error: status code 404, net::ERR_UNKNOWN_URL_SCHEME
DevTools failed to load source map: Could not load content for webpack://Quill/node_modules/quill-delta/dist/AttributeMap.js.map: HTTP error: status code 404, net::ERR_UNKNOWN_URL_SCHEME
DevTools failed to load source map: Could not load content for webpack://Quill/node_modules/quill-delta/dist/Op.js.map: HTTP error: status code 404, net::ERR_UNKNOWN_URL_SCHEME
DevTools failed to load source map: Could not load content for webpack://Quill/node_modules/quill-delta/dist/Iterator.js.map: HTTP error: status code 404, net::ERR_UNKNOWN_URL_SCHEME
DevTools failed to load source map: Could not load content for webpack://Quill/node_modules/quill-delta/dist/Delta.js.map: HTTP error: status code 404, net::ERR_UNKNOWN_URL_SCHEME
DevTools failed to load source map: Could not load content for webpack://Quill/node_modules/quill-delta/dist/AttributeMap.js.map: HTTP error: status code 404, net::ERR_UNKNOWN_URL_SCHEME
DevTools failed to load source map: Could not load content for webpack://Quill/node_modules/quill-delta/dist/Op.js.map: HTTP error: status code 404, net::ERR_UNKNOWN_URL_SCHEME
DevTools failed to load source map: Could not load content for webpack://Quill/node_modules/quill-delta/dist/Iterator.js.map: HTTP error: status code 404, net::ERR_UNKNOWN_URL_SCHEME
DevTools failed to load source map: Could not load content for chrome-extension://fheoggkfdfchfphceeifdbepaooicaho/sourceMap/chrome/content.map: HTTP error: status code 404, net::ERR_UNKNOWN_URL_SCHEME
DevTools failed to load source map: Could not load content for https://advay.pagekite.me/assets/js/socket.io.slim.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE

@lasalesi @Muzzy getting the same error on erpnext version 12.16.2