Reputation: 23
I'm trying to build an automation rule in Odoo 11 (enterprise) so my products can publish and unpublish on the website automatically.
We sell seasonal products, roughly 17.000, and we do a lot preparation in advance. So with "scheduling" (un)publish a product, we can save a lot work and automate this job.
So far with all my attempts, it's not working. I have created 2 custom fields for model product.template: x_publish_start and x_publish_end
I have created an automated action with trigger condition "based on timed condition" and apply it to products where x_publish_start is SET (not empty). Trigger date = x_publish_start
In the data to write, I have set the default field visible on website = TRUE
Basically, this should work?? But it's doing nothing in my end.
The condition is quite basic: if today() >= x_publish_start -> publish product if today() >= x_publish_end -> unpublish product
screenshot http://sharing.codeagency.be/0c0d7512e9f9
Anybody who knows what is wrong with my concept and automation, or can provide a working code example?
Thanks!
Upvotes: 0
Views: 302
Reputation: 6418
Those actions get triggered when editing a record (see action to do: update the record). What you need is more a cron that runs every day (or hour, minute...) and publishes/unpublishes products that match (or not) current date. The model you're looking for is ir.cron
.
Upvotes: 1