Submit Stock Entry taking too long time

hi, i want to ask about submitting Stock Entry,
i made some script for auto submit all my Stock Enty,
here the script :

> def submit_ste(self):
> 		counter = 0
> 		for si in frappe.get_all("Stock Entry", filters={"docstatus": 0}):
> 			if(counter < 10):
> 				si = frappe.get_doc("Stock Entry", 
> 				si.submit()
> 				counter = counter + 1

> 		msgprint("done")

and the problem is submitting need long time and always timeout if i subit more than 10… i check it with Firebug, if timeout none of my Stock Entry will be submitted.
why really take along time to submit stock entry? and why can timeout?
i try submit other things like Sales Order, Material Request, Journal Entry, none of them have the same problem like i submit the stock entry

oh ya, i make this script because if i submit via import excel also have the same problem, will timeout if more than 10 stock entry in 1 excel,
and i cannot submit manually by clicking the button because i have more than 800+ stock entry need to be submitted.

If they are back dated entries, the the system will forward post valuation rates everywhere and this can be slow.

You can added a frappe.db.commit() after every submit if you are willing to wait out.

1 Like

yah my entries are back dated…
thank you for your information,
ill try that