ReplenishmentOrders create Orders automatically

Hey there,

i’m quite new, using dolibarr 19.0.2.
i’m going step by step, since 6 months now. i’m at the point that i would to have an automatic Replenishment of stock items.

i’d like that the purchease orders get automatically created,
may i trigger create orders by cron/api

yes, you can create orders through the API, but there might be a module that can do actions, though I don’t remember the name of that module because I don’t use it

thanks a lot, but also the Replenishment Orders ? or create the Replenishment Orders automatically?

@lblabr Maybe? I think you should try it. The picture is from the API explorer found under Tools in top menu, and then API explorer in left side menu

but how to get the necessary orders? that needed to replenish stocks ?

I am not totally sure I understand what you are asking.

You can find stock contents using the API

so something could use the API to check on stocks and then order if necessary.

I use Dolibarr for dance classes so I do not uses stock management. There might be a build in module, there might be something at the Dolistore.

  • If you prefer a UI-driven approach → Use the Replenishment tool manually.
  • If you want automation without coding → Set up cron jobs for built-in replenishment.
  • If you need full automation & flexibility → Use the API with a script to monitor stock and create POs dynamically.

If you want automation without coding → Set up cron jobs for built-in replenishment.

sounds great how do i do that?

You must visit “Admin Tools” / “Scheduled Jobs” and add a new Job.

This one I’m showing here is for generate recurrent invoices for customers once per day:

Briefly: you must know which function must be called on which PHP file and put it there. Sincerely, I don’t know which function and file you need to call to generate self-replenishment purchase orders. Making a bit of searching in the code you will find “easily”.

By the way: this mechanism will work for you if you need or prefer to create your own PHP script to do other things. So is quite powerful and YOU DON’T NEED API’s neither MAKEs or ZAPIERs :sweat_smile:

https://doxygen.dolibarr.org/dolibarr_dev/build/html/d5/d94/replenish_8php_source.html

here is the code…

so far so ggod, what doe i need to call?

as it looks to me, the orders are collected by the data, the you may select by webform, and with th ebutton the orders are created.

but how to that with wich code?