How can we use OR condition in document naming rule

I am setting a condition where I want if there are two specified customer then it should take a specified series but currently I can not do this.
if I am creating two set of doc then it is giving me error that series is already exist.

is there any solution for this without using any custom script for the same.

You can use the logic in controller method

from frappe.model.naming import getseries
class DocType(Document):
    def autoname(self):
        Apply the logic
        ***** = #######