How to add a Closed state in Purchase Order Workflow

There is a Close action in Purchase Order, how do I get to implement that in a workflow. Currently it won’t allow to transition from Receive and Bill status to closed.

On clicking the Close workflow action, we get the below error

How can we Close the Purchase Order using the workflow action?

Your are updaing status field through workflow, so its giving error as its checking validation
you can write custom script to set status field or use exsting api (i;e. erpnext.buying.doctype.purchase_order.purchase_order.update_status)