WooCommerce connector for Tryton

Uuuuuuuh. I need to dress in sackcloth and ashes (hope this saying is correct in English)

And - especially for @pokoli - with your “¡”:
¡Mea Culpa!

You’re completely right - it was me to mess up the “order form” and the “invoice”. Obviously, they are not the same thing - but not obvious enough for my stupid mind.

Please accept my sincere apologies - I should have thought a little more about that!

Remains one thing: How do I mark items in woocommerce to be downloaded to tryton?
Once I know that, I’ll try to get a little more familiar with the module and then try to write a little HOWTO.

Cheers,
Wolf

You don’t it.

The process is as follow:

  • Products are categories are created on tryton.
  • Once added to a woocommerce web_shop they are uploaded to woocommerce.
  • Once there is a sale in woocommerce is downloaded in tryton

If you have an existing woocommerce website with products that you want to manage from tryton you should import them in tryton and set the proper woo_commerce_id on the tryton models so the system will correctly link them and do not create duplicate products on the next sync.

A post was split to a new topic: Deleting products added to a web shop

Hi all,

in Tryton I have a product with variants and attributes.
When uploading this product to WooCommerce, each of the product variant is uploaded as an independent product in woocommerce.

Is there a way to to upload a Tryton-product with variants and attributes, for example, as variable WooCommerce product with its corresponding variants and attributes?

Thanks and all the best,
Jan

Hi Jan,

When we initialy developed the cconnector we did not have any use case for the multiple variants. For this reason we did not implement this part.

As far as this configuration can be created from the API i do not see any problem to adapt the connector to support this case.

If you want to work on this I will be happy to review your work and include it on the woocommerce module.

Ok, I will try … :ok_hand:

@pokoli
AFAIK, there is not yet an update for 6.0. May I kindly remind you - if you occasionally have some spare time. No reason to rush…

Thanks a lot in advance,
Wolf

I’ve just pushed the update :wink:

Mr. Increcible ! :heart:

Now I tried to install it with the commands from #7:

git clone https://gitlab.com/kopen/web_shop
cd web_shop
python3 setup.py install
cd ..
...etc...

But whenever I do that, afterwards I find my site-packages crowded with 5.6 stuff, not 6.0. Do I need to specify the version?

Wolf

The web_shop module is part of tryton oficial packages since version 5.8. You should not install it from our repositories but use the pip package.

Indeed just cloning the web_shop_woocommerce module and installing it will install al the requirements for 6.0 series.

Ah, understood. So I installed web_shop without any trouble, web_shop_woocommerce seemed fine as well, but then:

$ trytond-admin -c trytond.conf -d tryton-60-exp -m -vv
6575 140326588610368 [2021-06-16 20:38:59,242] INFO trytond.backend.postgresql.database connection to "tryton-60-exp" succeeded
6575 140326588610368 [2021-06-16 20:38:59,739] INFO 
[many more lines]
...
...
...
setup mixin for "tryton-60-exp"
6575 140326588610368 [2021-06-16 20:39:01,062] INFO trytond.modules all modules loaded
6575 140326588610368 [2021-06-16 20:39:01,076] WARNING py.warnings /usr/lib/python3/dist-packages/apport/report.py:13: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
  import fnmatch, glob, traceback, errno, sys, atexit, locale, imp, stat

Traceback (most recent call last):
  File "/home/wd/tryton-60-exp/bin/trytond-admin", line 23, in <module>
    admin.run(options)
  File "/home/wd/tryton-60-exp/lib/python3.8/site-packages/trytond/admin.py", line 53, in run
    pool.init(update=options.update, lang=list(lang),
  File "/home/wd/tryton-60-exp/lib/python3.8/site-packages/trytond/pool.py", line 164, in init
    restart = not load_modules(
  File "/home/wd/tryton-60-exp/lib/python3.8/site-packages/trytond/modules/__init__.py", line 437, in load_modules
    _load_modules(update)
  File "/home/wd/tryton-60-exp/lib/python3.8/site-packages/trytond/modules/__init__.py", line 408, in _load_modules
    Configuration(1).check()
  File "/home/wd/tryton-60-exp/lib/python3.8/site-packages/trytond/modules/product/ir.py", line 20, in check
    if self.product_price_decimal != price_decimal:
  File "/home/wd/tryton-60-exp/lib/python3.8/site-packages/trytond/model/fields/field.py", line 344, in __get__
    return inst.__getattr__(self.name)
  File "/home/wd/tryton-60-exp/lib/python3.8/site-packages/trytond/model/modelstorage.py", line 1624, in __getattr__
    read_data = self.read(list(index.keys()), list(ffields.keys()))
  File "/home/wd/tryton-60-exp/lib/python3.8/site-packages/trytond/model/modelsingleton.py", line 38, in read
    singleton = cls.get_singleton()
  File "/home/wd/tryton-60-exp/lib/python3.8/site-packages/trytond/model/modelsingleton.py", line 23, in get_singleton
    singletons = super(ModelSingleton, cls).search([], limit=1)
  File "/home/wd/tryton-60-exp/lib/python3.8/site-packages/trytond/model/modelsql.py", line 1342, in search
    cursor.execute(*select)
  File "/home/wd/tryton-60-exp/lib/python3.8/site-packages/trytond/backend/postgresql/database.py", line 72, in execute
    cursor.execute(self, sql, args)
psycopg2.errors.UndefinedColumn: column a.product_price_decimal does not exist
LINE 1: ...ame" AS "hostname", "a"."language" AS "language", "a"."produ...
                                                         ^

I did the SQL changes from the update instructions before. Could that have been a problem?

Cheers,
Wolf

The problem is that you did not update all the modules. To upgrade between series you should use:

$ trytond-admin -c trytond.conf -d tryton-60-exp --all -vv

Note that I changed the -m to --all to indicate that all modules should be updated.

I already tried that, but got the same error message as above (without the leading success messages).

My guess is that my order of actions for the update process was not correct. I did:

  • set up a new database and imported data from the recent one
  • created a new PIP environment
  • installed the new trytond
  • installed a module manually from a *.whl file
  • did the [SQL] commands at a psql port
  • installed the new trytond-* modules from pypi
  • tried to install woocommerce from github
  • ran $ trytond-admin -c trytond.conf -d tryton-60-exp -m -vv
  • ran $ trytond-admin -c trytond.conf -d tryton-60-exp --all -vv

Could you kindly have a look at this list? - I’ll add the update process to my “beginners’ guide” then.

Cheers,
Wolf