Code for checking sales order status

I am trying to modify some code in a custom app. I am not an expert programmer.
More self taught.

This is the current code.

"status": ["!=", "Closed"]

From what I understand, the above code is, all sales orders that do not have “Closed” status.

What I need is, all sales orders that do not have “Closed” and “Draft” status.

AI is saying the following but I do not trust AI.

"status": ["not in", ["Closed", "Draft"]]

Need advice on right way to do this.

If possible, please let me know if this is the correct syntax?

yes it is right

Thank you very much for the advice. I do appreciate it very much.

For different type of filters, you can just check List View filters in UI.

This is so cool. I did not think about that. Very good advice. Thank you for sharing that.

Just for reference:

1 Like

Thank you for the example. It is very clear.
Thank you again for helping.

I am sure this will be helpful for other users of erpnext!

1 Like