def METHOD_NAME(self):
    """
    Autofill the Sale Order's FS location with the partner_id,
    the partner_shipping_id or the partner_id.commercial_partner_id if
    they are FS locations.
    """
    for so in self:
        if so.partner_id.fsm_location:
            domain = [("partner_id", "=", so.partner_id.id)]
        else:
            domain = [
                "|",
                "|",
                ("partner_id", "=", so.partner_id.id),
                ("partner_id", "=", so.partner_shipping_id.id),
                ("partner_id", "=", so.partner_id.commercial_partner_id.id),
            ]
        so.fsm_location_id = self.env["fsm.location"].search(domain, limit=1)