Once the sample order has been created, we can now create the script to duplicate it and modify the quantity according to the cosinus function we will use.
The custom script must be created in the 'custom' folder within the 'portal_skins' folder. In order to do so you must go to https://www.tiolive.com/YOURINSTANCEID/portal_skins/custom/manage
Once in this folder you must create a script, 'add' >> 'Script (Python)'. You should choose 'SaleOrder_generateCloneData' as script ID. Then click on 'Save & Edit'.
You should then type in the exact same script than above. Since it is a python script, please take care of the case and spaces before the lines.
Once it is saved, you can run the script on the previously created sale order by entering this URL in your browser:
https://www.tiolive.com/YOURINSTANCEID/sale_order_module/NUMBEROFTHEORDER/SaleOrder_generateCloneData
If everything is working properly, it should display “Done”
Ref:
- https://www.tiolive.com/G2nV0tfpR/portal_skins/custom/manage
- https://www.tiolive.com/G2nV0tfpR/portal_skins/custom/SaleOrder_generateCloneData
- https://www.tiolive.com/G2nV0tfpR/sale_order_module/38/SaleOrder_generateCloneData