Work Flow Bug. Document status changed to Approved but not actually submitted

We have created a work flow for material request.where purchase user can save the request and store manager can approve the request, The document will be submitted on approve.
Some time it is not working. It is showing that Document is approved but not actually submitted.

May I know version of your ERPNext account?

Please check if Allow on Submit is checked for the field in which editing is possible even after Approval.

@umair I am using Erp Version 7.2.11 & frappe version 7.2.9.the field allow on submit is not checked.
when I deactivate the work flow the document status showing as draft.

@Prashanta_Mahato

can you share TRANSITION RULES of your workflow.

@Prashanta_Mahato

I created workflow for Material Request on https://demo.erpnext.com

This is my submitted material request after Approve. It’s working fine.

Is there any error or something while approve in your workflow?

1 Like

It is working for me too. but some time it’s not working. if there is some error then document should not be approved while its not submittable.But in my case the document getting approved but not submitted.

I have disable the work flow and then try to submit the document manualy but its throwing error.

Traceback (most recent call last):
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/app.py”, line 55, in application
response = frappe.handler.handle()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/handler.py”, line 19, in handle
execute_cmd(cmd)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/handler.py”, line 40, in execute_cmd
ret = frappe.call(method, **frappe.form_dict)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/init.py”, line 897, in call
return fn(*args, **newargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/desk/form/save.py”, line 19, in savedocs
doc.submit()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 723, in submit
self._submit()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 712, in _submit
self.save()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 223, in save
return self._save(*args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 269, in _save
self.run_post_save_methods()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 771, in run_post_save_methods
self.run_method(“on_submit”)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 653, in run_method
self.run_email_alerts(method)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 699, in run_email_alerts
_evaluate_alert(alert)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 683, in _evaluate_alert
evaluate_alert(self, alert.name, alert.event)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/email/doctype/email_alert/email_alert.py”, line 194, in evaluate_alert
alert.send(doc)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/email/doctype/email_alert/email_alert.py”, line 128, in send
attachments = [frappe.attach_print(doc.doctype, doc.name)] if self.attach_print else None)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/init.py”, line 1200, in attach_print
“fcontent”: get_print(doctype, name, print_format=print_format, style=style, html=html, as_pdf=True, doc=doc)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/init.py”, line 1183, in get_print
return get_pdf(html, output = output)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/utils/pdf.py”, line 17, in get_pdf
pdfkit.from_string(html, fname, options=options or {})
File “/home/ubuntu/frappe-bench/env/src/pdfkit/pdfkit/api.py”, line 68, in from_string
return r.to_pdf(output_path)
File “/home/ubuntu/frappe-bench/env/src/pdfkit/pdfkit/pdfkit.py”, line 143, in to_pdf
raise IOError(“wkhtmltopdf exited with non-zero code {0}. error:\n{1}”.format(exit_code, stderr.decode(“utf-8”)))
IOError: wkhtmltopdf exited with non-zero code -11. error:

In that case, refer following thread

wkhtmltox is already the newest version.

Kindly help.

I think this one is work flow bug. Document is approved but not submitted.
I am requesting ErpNext team to fix this bug.