WooCommerce connector for Tryton

Did you have any confirmed order on the Woocommerce shop?

The module will raise an Error if there is some problem syncronizing.

Yes, i have a few orders with woocommerce status “completed”, “processing” and “cancelled”.

Hmm…? Where am i supposed to see the downloaded orders in tryton, under Sales > Sales?

What i did inside tryton is roughly the following: I set up one party and one product. I used Inventories to stock up the warehouse with the product. I created a webshop and asigned it to the party, the warehouse and the product. Now i can push the stock amount, price etc. from tryton to woocommerce but i don’t see the downloaded orders.

Only on-hold orders are downloaded and then it’s status is update to processing on Woocomerce.
Then when the goods are sent the order is marked as Completed on WooCommerce.

1 Like

It works :heart_eyes:

1 Like

I’ve updated the module documentation to explain how the module works. I hope this makes it easier for others to properly understand the behaviour of the module. Let me know if there is something else that need to be clarified.

Happy to read feedback from happy users!

2 Likes

New year, new attempt.

Sorry, still I’m not happy with an invoice I cannot change.

  • We’re on holidays. Orders came in, but we’re not working. So invoice date would be in the last year, although actual shipping happens next week, nearly mid of January. Not nice.
  • Customer purchased wrong shipment method - I cannot change that without hassle.

Sorry having to insist - but still it does not work for me this way.

In the meanwhile, I understood that products to be synced need to be added under
[menu] > sales > settings > webshops - articles
Actually, these are synced now.

I could not find how to achieve it the other way - download from woocommerce to tryton.

I do not know why you are having issues with invoices as the connector does anything with them.

For me the current workflow is correct. The connector downloads the sales order with the date of the customer order and leaves it as processing. Then invoice is created depending following your default invoice method but is always created in the draft state so you can adjust the invoice date to the previous fiscalyear if required.

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