Woocommerce full 2 way integration

Hello @lasalesi the installation is working clean now on setups, glad this part of the issue is resolved

Another issue i am experience is Orders are not syncing…Can you please give a pointer based on my traceback what my issue is

Hi @EnSeal,
Please urgently change your WooCommerce key and secret, as they are in your trace.
The trace reports error 400, the page was not found. Does the rest of the sync like products work? You can also debug the interface by calling it from a webbrowser…

Not sure if this is resolved already, but can you check the access level of your key in WooCommerce? It should have both read and write access…

thanks @lasalesi keys deleted.

Yes Products sync successfully…issue is just with the sales order now

Hey @lasalesi

Found this on my error log. Now i am getting sync successful but no orders on erpnext

{‘e’: InternalError(1054, “Unknown column ‘barcode’ in ‘where clause’”), ‘method_name’: ‘woocommerceconnector.sync_products.add_w_id_to_erp’, ‘log’: <function log at 0x7fd990b36400>, ‘retry’: 0, ‘is_async’: True, ‘user’: ‘Administrator’, ‘kwargs’: {}, ‘job_name’: ‘woocommerceconnector.sync_products.add_w_id_to_erp’, ‘event’: None, ‘method’: <function add_w_id_to_erp at 0x7fd990861f28>, ‘site’: ‘vm12’}
Traceback (most recent call last):
File “/home/frappe/bench12/apps/frappe/frappe/utils/background_jobs.py”, line 99, in execute_job
method(**kwargs)
File “/home/frappe/bench12/apps/woocommerceconnector/woocommerceconnector/sync_products.py”, line 506, in add_w_id_to_erp
frappe.db.sql(update_item)
File “/home/frappe/bench12/apps/frappe/frappe/database/database.py”, line 171, in sql
self._cursor.execute(query)
File “/home/frappe/bench12/env/lib/python3.6/site-packages/pymysql/cursors.py”, line 170, in execute
result = self._query(query)
File “/home/frappe/bench12/env/lib/python3.6/site-packages/pymysql/cursors.py”, line 328, in _query
conn.query(q)
File “/home/frappe/bench12/env/lib/python3.6/site-packages/pymysql/connections.py”, line 517, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File “/home/frappe/bench12/env/lib/python3.6/site-packages/pymysql/connections.py”, line 732, in _read_query_result
result.read()
File “/home/frappe/bench12/env/lib/python3.6/site-packages/pymysql/connections.py”, line 1075, in read
first_packet = self.connection._read_packet()
File “/home/frappe/bench12/env/lib/python3.6/site-packages/pymysql/connections.py”, line 684, in _read_packet
packet.check_error()
File “/home/frappe/bench12/env/lib/python3.6/site-packages/pymysql/protocol.py”, line 220, in check_error
err.raise_mysql_exception(self._data)
File “/home/frappe/bench12/env/lib/python3.6/site-packages/pymysql/err.py”, line 109, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.InternalError: (1054, “Unknown column ‘barcode’ in ‘where clause’”)

Can you please make sure that your Item Doctype has a field “barcode” (was replaced by the barcode table in V12, should still be there, but new systems might miss this) You can add it with Menu > Customize

Hi, I’m new to all of this. Just one question, would this allow you to sync sets of products to multiple WooCommerce instances?

Or does it allow only for 1 Woocommerce connection?

1 Like

We have not even been able to make it work for one woocommerce instance yet…lol

Anyone apart from @lasalesi who has succeeded in making this work please holla at us.

Regards

1 Like

Sorry guys, but a quick question, there is already a woocommerce integration in v12, why the new connector ? is there something faulty with the one shipped with erpnext? or not doing sync as it must do? or a limitation? as i dont know yet
Thanks

1 Like

Hi,
Is there a way to know what field are synced with woo commerce. I tried to look at the code but I’m not sure I understand everything.

I’m currently trying a woocommerce php pluging that is sync custom fields from erpnext but I’m still very interested in your module but I would need help to integrate it. Any suggestion on who could help if you dont have time. If not I’ll post on freelancer.

Hi @a.elhaidary,

thanks for your input. The integration in v12 came later than the connector and has far as I know it does not support multiple stock locations… Apart from the install issues in v12 with the connector, it actually works very well (and these have been resolved afaik)…

No it does not

@EnSeal

Hi @olamide_shodunke,

were you successful with the integrated option? Or do you care to share your status?

@lasalesi

Unfortunately we couldn’t make the app work…the app won’t even install on v11 at all which is where we have our production instance…

While on v12 orders won’t sync back into ERPNext…

1 Like

Israel.l could you be more specific ?

What challenges did you have on v11 and what challenges did you have on v12

In my opinion your statement above is not helpful

Hi @EnSeal,
thanks for your feedback, sorry to hear that. We unfortunately no longer actively support v11, but on v12 it should in any case work. Do you have details, why the orders are not being pulled? There could be a cloud in the WooCommerce Log (sync started, …). If the connection works, items are synced, the sales order should also be able to be read…

@lasalesi does it sync inventory. Is sales invoice made in ERPNext or Sales order. Can you give more information of the 2 way functions.

I am on V12.7, python3.6 - getting the following error on bench --site erp.domain.com install-app woocommerceconnector command:

ImportError: Module import failed for Asset Settings (erpnext.assets.doctype.asset_settings.asset_settings Error: No module named 'erpnext.assets.doctype.asset_settings.asset_settings')

Will appreciate any guidance on how to resolve. Thanks.

Traceback (most recent call last):
  File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/utils.py", line 204, in load_doctype_module
doctype_python_modules[key] = frappe.get_module(module_name)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 827, in get_module
return importlib.import_module(modulename)
  File "/home/frappe/frappe-bench/env/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'erpnext.assets.doctype.asset_settings.asset_settings'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 97, in <module>
main()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 18, in main
click.Group(commands=commands)(prog_name='bench')
  File "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
  File "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
  File "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
  File "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
  File "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 25, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py", line 179, in install_app
_install_app(app, verbose=context.verbose)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/installer.py", line 85, in install_app
add_to_installed_apps(name)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/installer.py", line 109, in add_to_installed_apps
post_install(rebuild_website)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/installer.py", line 170, in post_install
init_singles()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/installer.py", line 188, in init_singles
doc = frappe.new_doc(single)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 687, in new_doc
return get_new_doc(doctype, parent_doc, parentfield, as_dict=as_dict)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/create_new.py", line 21, in get_new_doc
frappe.local.new_doc_templates[doctype] = make_new_doc(doctype)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/create_new.py", line 39, in make_new_doc
"docstatus": 0
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 753, in get_doc
doc = frappe.model.document.get_doc(*args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 69, in get_doc
controller = get_controller(doctype)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py", line 47, in get_controller
module = load_doctype_module(doctype, module_name)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/utils.py", line 206, in load_doctype_module
raise ImportError('Module import failed for {0} ({1})'.format(doctype, module_name + ' Error: ' + str(e)))
ImportError: Module import failed for Asset Settings (erpnext.assets.doctype.asset_settings.asset_settings Error: No module named 'erpnext.assets.doctype.asset_settings.asset_settings')

Could fix it - dont know if it is right way - with following commands:

$ bench mariadb
> delete from `tabDocType` where `name` = "Asset Settings";

Was able to install-app after the above command. However bench update then fails / gives error:

ERROR: Command errored out with exit status 1:
 command: /home/frappe/frappe-bench/env/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/frappe/frappe-bench/apps/woocommerceconnector/setup.py'"'"'; __file__='"'"'/home/frappe/frappe-bench/apps/woocommerceconnector/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-cpxffbnt
     cwd: /home/frappe/frappe-bench/apps/woocommerceconnector/
Complete output (7 lines):
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/frappe/frappe-bench/apps/woocommerceconnector/setup.py", line 27, in <module>
    install_requires=[str(ir.req) for ir in requirements],
  File "/home/frappe/frappe-bench/apps/woocommerceconnector/setup.py", line 27, in <listcomp>
    install_requires=[str(ir.req) for ir in requirements],
AttributeError: 'ParsedRequirement' object has no attribute 'req'
----------------------------------------
`ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.`

Uninstalled the app for the site and then did a bench remove-app . Attempted to reinstall it. Get error on get-app command now. Seems cannot uninstall / remove app and reinstall it. Restored container from snapshot.

Appreciate any pointers.

I have this same error, can I ask how you solve this issue?

1 Like