I created (or rather AI did) a wizard to monitor the range of coverage of my stock - a problem that regularly caused headaches to me. It checks stock and calculates average sales in a reference period of time I can type in. Works nicely.
Now I’d like to call it every 2 weeks by a Tryton cron - but AI suggestions for that are quite complicated. So before I try some messy things… - is there a straightforward mechanism how a wizard can be launched by Tryton’s cron?
Thank you for you kind answer. I forwarded it to AI (I myself unluckily cannot deal with it), and this is the answer:
However, it doesn’t work with our wizard for two reasons:
The stock.supply wizard operates in the create_ state and writes directly to the database (purchase requests). Our wizard returns data and a report; the file is only created on the client side. If it runs via Cron, no file is created anywhere. Cron does not recognize inputs such as category, time period, and storage locations. These would have to be hard-coded into the code.
I know it’s really a tall order to argue with AI content, please don’t feel obliged to comment on this. But I wanted to let you know that I tried my best to make use of your suggestion.
A cron wizard neither can rely on a user input dialogue and input nor producing any output in the client, like a report or opening a list view.
Watch out for the over-engineering-trap. Instead of implementing …
… this hard-coded defaults and sending the report via e-mail… just set a periodical calendar reminder and call your wizard manually every 2 weeks, with the parameter you need, print the report will cost around one hour labour per year (52weeks/2 times x 2.5min).
Hey Udo, we are the Germans - we stand for over-engineering, don’t we…? (;
But to be serious:
I don’t question your maths, but I have a number of regular reminders in my calendar, which I frequently ignore. I do need Tryton to remind me on the spot, punch the info right into my face - otherwise I’ll forget about it. And I notice it’s getting worse with growing older.
So I’ll have to dive into this topic more deeply anyway.